From 8d48a1eff0f65ba0e66023d92670b90e56e905f0 Mon Sep 17 00:00:00 2001 From: atolkachev Date: Thu, 27 Nov 2025 14:28:55 +0100 Subject: [PATCH] Migrate from Build API to Pipelines API - Upgrade azure-devops-node-api from v11.0.1 to v15.1.1 - Replace BuildApi with PipelinesApi for pipeline execution - Add support for template parameters via azure-pipeline-parameters input - Convert variables to Pipelines API format {value: string} - Pass repository resources (branch and commit) to pipeline runs - Add explicit pipeline existence validation - Update README with new parameter documentation --- README.md | 1 + __tests__/main.test.ts | 343 +- action.yml | 3 + dist/index.js | 41139 ++++++++++++++++++++++++++------------- dist/package.json | 19 +- lib/pipeline.runner.js | 96 +- lib/task.parameters.js | 4 + package-lock.json | 577 +- package.json | 6 +- src/pipeline.runner.ts | 103 +- src/task.parameters.ts | 6 + 11 files changed, 28200 insertions(+), 14097 deletions(-) diff --git a/README.md b/README.md index 999a200d..9e6a760b 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Action takes Project URL, pipeline name and a [Personal Access Token (PAT)](http azure-pipeline-name: 'pipeline-name' # name of the Azure pipeline to be triggered azure-devops-token: '${{ secrets.AZURE_DEVOPS_TOKEN }}' azure-pipeline-variables: '{"variable1": "value1", "variable2": "value2"}' # optional stringified json + azure-pipeline-parameters: '{"param1": "value1", "param2": "value2"}' # optional stringified json ``` # Contributing diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 6607eb2b..d6eb3bee 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -6,59 +6,42 @@ import { UrlParser } from '../src/util/url.parser' import * as core from '@actions/core'; import { PipelineNotFoundError } from '../src/pipeline.error'; -var mockQueueBuildResult; -const mockQueueBuild = jest.fn().mockImplementation(() => { - return mockQueueBuildResult; -}); - -var mockBuildDefinition; -const mockGetDefinition = jest.fn().mockImplementation(() => { - return mockBuildDefinition; -}); - -var mockBuildDefinitions; -const mockGetDefinitions = jest.fn().mockImplementation(() => { - return mockBuildDefinitions; -}); - -const mockGetBuildApi = jest.fn().mockImplementation(() => { - return { - getDefinitions: (projectName, pipelineName) => mockGetDefinitions(projectName, pipelineName), - getDefinition: (projectId, buildId) => mockGetDefinition(projectId, buildId), - queueBuild: (build, projectId, ignoreWarnings) => mockQueueBuild(build, projectId, ignoreWarnings) - } -}); +var mockGetPersonalAccessTokenHandler: jest.Mock; +var mockListPipelines: jest.Mock; +var mockRunPipeline: jest.Mock; +var mockGetPipelinesApi: jest.Mock; +var mockGetReleaseDefinitions: jest.Mock; +var mockCreateRelease: jest.Mock; +var mockGetReleaseApi: jest.Mock; -const mockGetPersonalAccessTokenHandler = jest.fn().mockImplementation(); - -var mockReleaseDefinitions; -const mockGetReleaseDefinitions = jest.fn().mockImplementation(() => { - return mockReleaseDefinitions; -}); - -var mockReleaseResponse; -const mockCreateRelease = jest.fn().mockImplementation(() => { - return mockReleaseResponse; -}); +jest.mock('azure-devops-node-api', () => { + mockGetPersonalAccessTokenHandler = jest.fn(); + mockListPipelines = jest.fn(); + mockRunPipeline = jest.fn(); + mockGetPipelinesApi = jest.fn().mockImplementation(async () => ({ + listPipelines: (...args: any[]) => mockListPipelines(...args), + runPipeline: (...args: any[]) => mockRunPipeline(...args) + })); + mockGetReleaseDefinitions = jest.fn(); + mockCreateRelease = jest.fn(); + mockGetReleaseApi = jest.fn().mockImplementation(async () => ({ + getReleaseDefinitions: (...args: any[]) => mockGetReleaseDefinitions(...args), + createRelease: (...args: any[]) => mockCreateRelease(...args) + })); -const mockGetReleaseApi = jest.fn().mockImplementation(() => { return { - getReleaseDefinitions: (project, searchText, artifactType) => mockGetReleaseDefinitions(project, searchText, artifactType), - createRelease: (releaseStartMetadata, project) => mockCreateRelease(releaseStartMetadata, project) - } + getPersonalAccessTokenHandler: (...args: any[]) => mockGetPersonalAccessTokenHandler(...args), + WebApi: jest.fn().mockImplementation(() => ({ + getPipelinesApi: (...args: any[]) => mockGetPipelinesApi(...args), + getReleaseApi: (...args: any[]) => mockGetReleaseApi(...args), + })) + }; }); -jest.mock('azure-devops-node-api', () => { - return { - getPersonalAccessTokenHandler: (token) => mockGetPersonalAccessTokenHandler(token), - WebApi: jest.fn().mockImplementation(() => { - return { - getBuildApi: async (url, handler) => await mockGetBuildApi(url, handler), - getReleaseApi: async () => await mockGetReleaseApi(), - } - }) - } -}); +let mockPipelineList: any; +let mockRunPipelineResult: any; +let mockReleaseDefinitions: any; +let mockReleaseResponse: any; describe('Testing all functions of class PipelineHelper', () => { test('EnsureValidPipeline() - throw error if definition not found', () => { @@ -70,9 +53,9 @@ describe('Testing all functions of class PipelineHelper', () => { }); test('equals() - return if strings are equal', () => { - expect(PipelineHelper.equals(null, null)).toBeTruthy(); - expect(PipelineHelper.equals('a', null)).toBeFalsy(); - expect(PipelineHelper.equals(null, 'a')).toBeFalsy(); + expect(PipelineHelper.equals(null as any, null as any)).toBeTruthy(); + expect(PipelineHelper.equals('a', null as any)).toBeFalsy(); + expect(PipelineHelper.equals(null as any, 'a')).toBeFalsy(); expect(PipelineHelper.equals('a', 'a ')).toBeTruthy(); expect(PipelineHelper.equals('a', 'A')).toBeTruthy(); expect(PipelineHelper.equals('a', 'b')).toBeFalsy(); @@ -90,8 +73,8 @@ describe('Testing all functions of class PipelineHelper', () => { test('isGitHubArtifact() - returns if artifact if of type github', () => { expect(PipelineHelper.isGitHubArtifact({})).toBeFalsy(); - expect(PipelineHelper.isGitHubArtifact({ type: 'githuB' })).toBeTruthy(); - expect(PipelineHelper.isGitHubArtifact({ type: null })).toBeFalsy(); + expect(PipelineHelper.isGitHubArtifact({ type: 'githuB' })).toBeTruthy(); + expect(PipelineHelper.isGitHubArtifact({ type: null as any })).toBeFalsy(); }); test('getErrorAndWarningMessageFromBuildResult() - concatenate and return errors', () => { @@ -141,7 +124,7 @@ describe('Testing all functions of class UrlParser', () => { }); test('GetProjectName() - throw error if null or empty', () => { - expect(() => UrlParser.GetProjectName(null)).toThrow('Project url is null or empty. Specify the valid project url and try again'); + expect(() => UrlParser.GetProjectName(null as any)).toThrow('Project url is null or empty. Specify the valid project url and try again'); expect(() => UrlParser.GetProjectName('')).toThrow('Project url is null or empty. Specify the valid project url and try again'); }); @@ -155,7 +138,7 @@ describe('Testing all functions of class UrlParser', () => { }); test('GetCollectionUrlBase() - throw error if null or empty', () => { - expect(() => UrlParser.GetCollectionUrlBase(null)).toThrow('Project url is null or empty. Specify the valid project url and try again'); + expect(() => UrlParser.GetCollectionUrlBase(null as any)).toThrow('Project url is null or empty. Specify the valid project url and try again'); expect(() => UrlParser.GetCollectionUrlBase('')).toThrow('Project url is null or empty. Specify the valid project url and try again'); }); @@ -165,143 +148,131 @@ describe('Testing all functions of class UrlParser', () => { }); describe('Testing all functions of class PipelineRunner', () => { - test('start() - regular run using env variables and inputs to trigger a run', async () => { - jest.spyOn(core, 'getInput').mockImplementation((input, options) => { + const setupCoreInputs = () => { + return jest.spyOn(core, 'getInput').mockImplementation(((input: string) => { process.env['GITHUB_REPOSITORY'] = 'repo_name'; process.env['GITHUB_REF'] = 'releases'; process.env['GITHUB_SHA'] = 'sampleSha'; - if (input == 'azure-devops-project-url') return 'https://dev.azure.com/organization/my-project'; - if (input == 'azure-pipeline-name') return 'my-pipeline'; - if (input == 'azure-devops-token') return 'my-token'; - }); - jest.spyOn(core, 'debug').mockImplementation(); - jest.spyOn(core, 'info').mockImplementation(); - mockBuildDefinitions = [{ - id: 5 - }]; - mockBuildDefinition = { - id: 5, - repository: { - id: 'repo', - type: 'Devops' - }, - project: { - id: 'my-project' - }, - } - mockQueueBuildResult = { - _links: { - web: { - href: 'linkToRun' - } - } + if (input === 'azure-devops-project-url') return 'https://dev.azure.com/organization/my-project'; + if (input === 'azure-pipeline-name') return 'my-pipeline'; + if (input === 'azure-devops-token') return 'my-token'; + if (input === 'azure-pipeline-variables') return undefined as any; + return '' as any; + }) as any); + }; + + beforeEach(() => { + mockPipelineList = [{ id: 5, name: 'my-pipeline' }]; + mockRunPipelineResult = { + id: 101, + _links: { web: { href: 'linkToRun' } }, + result: 'succeeded' }; - expect(await (new PipelineRunner(TaskParameters.getTaskParams())).start()).toBeUndefined(); - expect(mockGetPersonalAccessTokenHandler).toBeCalledWith('my-token'); - expect(mockGetBuildApi).toBeCalled(); - expect(mockGetDefinitions).toBeCalledWith('my-project', 'my-pipeline'); - expect(mockGetDefinition).toBeCalledWith('my-project', 5); - const expectedBuild = { - definition: { - id: 5, - }, - project: { - id: 'my-project', - }, - reason: 1967, - sourceBranch: null, - sourceVersion: null, - } - expect(mockQueueBuild).toBeCalledWith(expectedBuild, 'my-project', true); + mockListPipelines.mockReset(); + mockListPipelines.mockImplementation(() => mockPipelineList); + + mockRunPipeline.mockReset(); + mockRunPipeline.mockImplementation(() => mockRunPipelineResult); + + mockGetPipelinesApi.mockReset(); + mockGetPipelinesApi.mockImplementation(async () => ({ + listPipelines: mockListPipelines, + runPipeline: mockRunPipeline + })); + + mockGetPersonalAccessTokenHandler.mockReset(); + + mockReleaseDefinitions = undefined; + mockReleaseResponse = undefined; + + mockGetReleaseDefinitions.mockReset(); + mockGetReleaseDefinitions.mockImplementation(() => mockReleaseDefinitions); + + mockCreateRelease.mockReset(); + mockCreateRelease.mockImplementation(() => mockReleaseResponse); + + mockGetReleaseApi.mockReset(); + mockGetReleaseApi.mockImplementation(async () => ({ + getReleaseDefinitions: mockGetReleaseDefinitions, + createRelease: mockCreateRelease + })); }); - test('start() - set core failed in RunYamlPipeline if result has errors', async () => { - jest.spyOn(core, 'getInput').mockImplementation((input, options) => { - process.env['GITHUB_REPOSITORY'] = 'repo_name'; - process.env['GITHUB_REF'] = 'releases'; - process.env['GITHUB_SHA'] = 'sampleSha'; + afterEach(() => { + jest.restoreAllMocks(); + }); - if (input == 'azure-devops-project-url') return 'https://dev.azure.com/organization/my-project'; - if (input == 'azure-pipeline-name') return 'my-pipeline'; - if (input == 'azure-devops-token') return 'my-token'; - }); + test('start() triggers a pipeline run with repo context', async () => { + setupCoreInputs(); jest.spyOn(core, 'debug').mockImplementation(); jest.spyOn(core, 'info').mockImplementation(); - jest.spyOn(core, 'setFailed').mockImplementation(); - mockBuildDefinitions = [{ - id: 5 - }]; - mockBuildDefinition = { - id: 5, - repository: { - id: 'repo_name', - type: 'Github' - }, - project: { - id: 'my-project' - }, - } - mockQueueBuildResult = { - validationResults: [{}] - }; - expect(await (new PipelineRunner(TaskParameters.getTaskParams())).start()).toBeUndefined(); - expect(mockGetPersonalAccessTokenHandler).toBeCalledWith('my-token'); - expect(mockGetBuildApi).toBeCalled(); - expect(mockGetDefinitions).toBeCalledWith('my-project', 'my-pipeline'); - expect(mockGetDefinition).toBeCalledWith('my-project', 5); - const expectedBuild = { - definition: { - id: 5, - }, - project: { - id: 'my-project', - }, - reason: 1967, - sourceBranch: 'releases', - sourceVersion: 'sampleSha', - } - expect(mockQueueBuild).toBeCalledWith(expectedBuild, 'my-project', true); - expect(core.setFailed).toBeCalled(); - }); - test('start() - set core failed in case of invalid response', async () => { - jest.spyOn(core, 'getInput').mockImplementation((input, options) => { - process.env['GITHUB_REPOSITORY'] = 'repo_name'; - process.env['GITHUB_REF'] = 'releases'; - process.env['GITHUB_SHA'] = 'sampleSha'; + await expect(new PipelineRunner(TaskParameters.getTaskParams()).start()).resolves.toBeUndefined(); + + expect(mockGetPersonalAccessTokenHandler).toHaveBeenCalledWith('my-token'); + expect(mockGetPipelinesApi).toHaveBeenCalled(); + expect(mockListPipelines).toHaveBeenCalledWith('my-project'); + expect(mockRunPipeline).toHaveBeenCalledWith( + expect.objectContaining({ + resources: { + repositories: { + self: { + refName: 'releases', + version: 'sampleSha' + } + } + }, + variables: undefined + }), + 'my-project', + 5 + ); + }); - if (input == 'azure-devops-project-url') return 'https://dev.azure.com/organization/my-project'; - if (input == 'azure-pipeline-name') return 'my-pipeline'; - if (input == 'azure-devops-token') return 'my-token'; - }); + test('start() sets failed when runPipeline throws', async () => { + setupCoreInputs(); jest.spyOn(core, 'debug').mockImplementation(); jest.spyOn(core, 'info').mockImplementation(); - jest.spyOn(core, 'setFailed').mockImplementation(); - mockBuildDefinitions = [{}, {}]; + const setFailedSpy = jest.spyOn(core, 'setFailed').mockImplementation(); + const runError = new Error('pipeline run failed'); + mockRunPipeline.mockImplementation(() => { throw runError; }); - expect(await (new PipelineRunner(TaskParameters.getTaskParams())).start()).toBeUndefined(); - expect(mockGetPersonalAccessTokenHandler).toBeCalledWith('my-token'); - expect(mockGetBuildApi).toBeCalled(); - expect(mockGetDefinitions).toBeCalledWith('my-project', 'my-pipeline'); - expect(core.setFailed).toBeCalled(); + await expect(new PipelineRunner(TaskParameters.getTaskParams()).start()).resolves.toBeUndefined(); + + expect(mockGetPipelinesApi).toHaveBeenCalled(); + expect(mockRunPipeline).toHaveBeenCalled(); + expect(setFailedSpy).toHaveBeenCalledWith(runError.message); }); - test('start() - trigger designer pipeline in case of PipelineNotFoundError', async () => { - jest.spyOn(core, 'getInput').mockImplementation((input, options) => { - process.env['GITHUB_REPOSITORY'] = 'repo_name'; - process.env['GITHUB_REF'] = 'releases'; - process.env['GITHUB_SHA'] = 'sampleSha'; + test('start() sets failed when pipeline metadata is invalid', async () => { + setupCoreInputs(); + jest.spyOn(core, 'debug').mockImplementation(); + jest.spyOn(core, 'info').mockImplementation(); + const setFailedSpy = jest.spyOn(core, 'setFailed').mockImplementation(); + const validationError = new Error('invalid metadata'); + const ensureSpy = jest.spyOn(PipelineHelper, 'EnsureValidPipeline').mockImplementation(() => { throw validationError; }); - if (input == 'azure-devops-project-url') return 'https://dev.azure.com/organization/my-project'; - if (input == 'azure-pipeline-name') return 'my-pipeline'; - if (input == 'azure-devops-token') return 'my-token'; - }); + await expect(new PipelineRunner(TaskParameters.getTaskParams()).start()).resolves.toBeUndefined(); + + expect(mockGetPipelinesApi).toHaveBeenCalled(); + expect(setFailedSpy).toHaveBeenCalledWith(validationError.message); + + ensureSpy.mockRestore(); + }); + + test('start() triggers release pipeline when YAML pipeline missing', async () => { + setupCoreInputs(); jest.spyOn(core, 'debug').mockImplementation(); jest.spyOn(core, 'info').mockImplementation(); jest.spyOn(core, 'setFailed').mockImplementation(); - mockBuildDefinitions = null; + const ensureSpy = jest.spyOn(PipelineHelper, 'EnsureValidPipeline') + .mockImplementationOnce(() => { + throw new PipelineNotFoundError('not found'); + }) + .mockImplementation(() => undefined as any); + mockReleaseDefinitions = [{ id: 5, artifacts: [] @@ -312,19 +283,23 @@ describe('Testing all functions of class PipelineRunner', () => { href: 'linkToRun' } } - } - - expect(await (new PipelineRunner(TaskParameters.getTaskParams())).start()).toBeUndefined(); - expect(mockGetPersonalAccessTokenHandler).toBeCalledWith('my-token'); - expect(mockGetBuildApi).toBeCalled(); - expect(mockGetDefinitions).toBeCalledWith('my-project', 'my-pipeline'); - expect(mockGetReleaseApi).toBeCalled(); - expect(mockGetReleaseDefinitions).toBeCalledWith('my-project', 'my-pipeline', 4); - const expectedRelease = { - artifacts: [], - definitionId: 5, - reason: 2 }; - expect(mockCreateRelease).toBeCalledWith(expectedRelease, "my-project"); + + await expect(new PipelineRunner(TaskParameters.getTaskParams()).start()).resolves.toBeUndefined(); + + expect(mockGetPipelinesApi).toHaveBeenCalled(); + expect(mockListPipelines).toHaveBeenCalledWith('my-project'); + expect(mockGetReleaseApi).toHaveBeenCalled(); + expect(mockGetReleaseDefinitions).toHaveBeenCalledWith('my-project', 'my-pipeline', 4); + expect(mockCreateRelease).toHaveBeenCalledWith( + expect.objectContaining({ + definitionId: 5, + artifacts: [], + reason: 2 + }), + 'my-project' + ); + + ensureSpy.mockRestore(); }); -}); \ No newline at end of file +}); \ No newline at end of file diff --git a/action.yml b/action.yml index 7a6b093f..52d3c399 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,9 @@ inputs: azure-devops-token: description: 'Paste personal access token of the user as value of secret variable:AZURE_DEVOPS_TOKEN' required: true + azure-pipeline-parameters: + description: 'Pipeline parameters to trigger the pipeline with' + required: false runs: using: 'node16' main: 'dist/index.js' \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index ee707649..e1d2fb8c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -118,7 +118,6 @@ const azdev = __importStar(__nccwpck_require__(7967)); const task_parameters_1 = __nccwpck_require__(7800); const pipeline_error_1 = __nccwpck_require__(7337); const ReleaseInterfaces = __importStar(__nccwpck_require__(7421)); -const BuildInterfaces = __importStar(__nccwpck_require__(2167)); const pipeline_helper_1 = __nccwpck_require__(9423); const logger_1 = __nccwpck_require__(4367); const url_parser_1 = __nccwpck_require__(2889); @@ -164,59 +163,58 @@ class PipelineRunner { return __awaiter(this, void 0, void 0, function* () { let projectName = url_parser_1.UrlParser.GetProjectName(this.taskParameters.azureDevopsProjectUrl); let pipelineName = this.taskParameters.azurePipelineName; - let buildApi = yield webApi.getBuildApi(); - // Get matching build definitions for the given project and pipeline name - const buildDefinitions = yield buildApi.getDefinitions(projectName, pipelineName); - pipeline_helper_1.PipelineHelper.EnsureValidPipeline(projectName, pipelineName, buildDefinitions); - // Extract Id from build definition - let buildDefinitionReference = buildDefinitions[0]; - let buildDefinitionId = buildDefinitionReference.id; - // Get build definition for the matching definition Id - let buildDefinition = yield buildApi.getDefinition(projectName, buildDefinitionId); - logger_1.Logger.LogPipelineObject(buildDefinition); - // Fetch repository details from build definition - let repositoryId = buildDefinition.repository.id.trim(); - let repositoryType = buildDefinition.repository.type.trim(); - let sourceBranch = null; - let sourceVersion = null; - // If definition is linked to existing github repo, pass github source branch and source version to build - if (pipeline_helper_1.PipelineHelper.equals(repositoryId, this.repository) && pipeline_helper_1.PipelineHelper.equals(repositoryType, this.githubRepo)) { - core.debug("pipeline is linked to same Github repo"); - sourceBranch = this.branch, - sourceVersion = this.commitId; - } - else { - core.debug("pipeline is not linked to same Github repo"); + let pipelinesApi = yield webApi.getPipelinesApi(); + // Get all pipelines for the project + const pipelines = yield pipelinesApi.listPipelines(projectName); + // Find the pipeline by name + const pipeline = pipelines.find((x) => x.name === pipelineName); + if (!pipeline) { + throw new pipeline_error_1.PipelineNotFoundError(`Pipeline "${pipelineName}" not found in project "${projectName}"`); } - let build = { - definition: { - id: buildDefinition.id - }, - project: { - id: buildDefinition.project.id - }, - sourceBranch: sourceBranch, - sourceVersion: sourceVersion, - reason: BuildInterfaces.BuildReason.Triggered, - parameters: this.taskParameters.azurePipelineVariables + pipeline_helper_1.PipelineHelper.EnsureValidPipeline(projectName, pipelineName, [pipeline]); + logger_1.Logger.LogPipelineObject(pipeline); + // Prepare run parameters + let runParameters = { + variables: undefined, + resources: { + repositories: { + self: { + refName: this.branch, + version: this.commitId + } + } + } }; - logger_1.Logger.LogPipelineTriggerInput(build); - // Queue build - let buildQueueResult = yield buildApi.queueBuild(build, build.project.id, true); - if (buildQueueResult != null) { - logger_1.Logger.LogPipelineTriggerOutput(buildQueueResult); - // If build result contains validation errors set result to FAILED - if (buildQueueResult.validationResults != null && buildQueueResult.validationResults.length > 0) { - let errorAndWarningMessage = pipeline_helper_1.PipelineHelper.getErrorAndWarningMessageFromBuildResult(buildQueueResult.validationResults); - core.setFailed("Errors: " + errorAndWarningMessage.errorMessage + " Warnings: " + errorAndWarningMessage.warningMessage); + // Set variables if provided + if (this.taskParameters.azurePipelineVariables) { + try { + const varsJson = JSON.parse(this.taskParameters.azurePipelineVariables); + // Convert to Pipeline API format: {key: {value: string, isSecret?: boolean}} + runParameters.variables = {}; + Object.keys(varsJson).forEach(key => { + runParameters.variables[key] = { value: varsJson[key] }; + }); } - else { - logger_1.Logger.LogPipelineTriggered(pipelineName, projectName); - if (buildQueueResult._links != null) { - logger_1.Logger.LogOutputUrl(buildQueueResult._links.web.href); - } + catch (e) { + core.warning("Failed to parse pipeline variables: " + e.message); } } + if (this.taskParameters.azurePipelineParameters) { + try { + runParameters.templateParameters = JSON.parse(this.taskParameters.azurePipelineParameters); + } + catch (e) { + core.warning("Failed to parse pipeline template parameters: " + e.message); + } + } + logger_1.Logger.LogPipelineTriggerInput(runParameters); + // Run pipeline + const runResult = yield pipelinesApi.runPipeline(runParameters, projectName, pipeline.id); + logger_1.Logger.LogPipelineTriggered(pipelineName, projectName); + logger_1.Logger.LogPipelineTriggerOutput(runResult); + if (runResult._links && runResult._links.web) { + logger_1.Logger.LogOutputUrl(runResult._links.web.href); + } }); } RunDesignerPipeline(webApi) { @@ -322,6 +320,7 @@ class TaskParameters { this._azureDevopsProjectUrl = core.getInput('azure-devops-project-url', { required: true }); this._azurePipelineName = core.getInput('azure-pipeline-name', { required: true }); this._azureDevopsToken = core.getInput('azure-devops-token', { required: true }); + this._azurePipelineParameters = core.getInput('azure-pipeline-parameters', { required: false }); this._azurePipelineVariables = core.getInput('azure-pipeline-variables', { required: false }); } static getTaskParams() { @@ -342,6 +341,9 @@ class TaskParameters { get azurePipelineVariables() { return this._azurePipelineVariables; } + get azurePipelineParameters() { + return this._azurePipelineParameters; + } } exports.TaskParameters = TaskParameters; @@ -2347,6 +2349,484 @@ function checkBypass(reqUrl) { exports.checkBypass = checkBypass; //# sourceMappingURL=proxy.js.map +/***/ }), + +/***/ 7770: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlertApi = void 0; +const basem = __nccwpck_require__(273); +const AlertInterfaces = __nccwpck_require__(6228); +class AlertApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Alert-api', options); + } + /** + * Get an alert. + * + * @param {string} project - Project ID or project name + * @param {number} alertId - ID of alert to retrieve + * @param {string} repository - Name or id of a repository that alert is part of + * @param {string} ref + * @param {AlertInterfaces.ExpandOption} expand - Expand alert attributes. Possible options are {ValidationFingerprint, None} + */ + getAlert(project, alertId, repository, ref, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + alertId: alertId, + repository: repository + }; + let queryValues = { + ref: ref, + expand: expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "e21b4630-b7d2-4031-99e3-3ad328cc4a7f", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, AlertInterfaces.TypeInfo.Alert, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get alerts for a repository + * + * @param {string} project - Project ID or project name + * @param {string} repository - The name or ID of the repository + * @param {number} top - The maximum number of alerts to return + * @param {string} orderBy - Must be "id" "firstSeen" "lastSeen" "fixedOn" or "severity" Defaults to "id" + * @param {AlertInterfaces.SearchCriteria} criteria - Options to limit the alerts returned + * @param {AlertInterfaces.AlertListExpandOption} expand + * @param {string} continuationToken - If there are more alerts than can be returned, a continuation token is placed in the "x-ms-continuationtoken" header. Use that token here to get the next page of alerts + */ + getAlerts(project, repository, top, orderBy, criteria, expand, continuationToken) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repository: repository + }; + let queryValues = { + top: top, + orderBy: orderBy, + criteria: criteria, + expand: expand, + continuationToken: continuationToken, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "e21b4630-b7d2-4031-99e3-3ad328cc4a7f", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, AlertInterfaces.TypeInfo.Alert, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get an alert. + * + * @param {string} project - Project ID or project name + * @param {number} alertId - ID of alert to retrieve + * @param {string} repository - Name or id of a repository that alert is part of + * @param {string} ref + * @param {AlertInterfaces.ExpandOption} expand - Expand alert attributes. Possible options are {ValidationFingerprint, None} + */ + getAlertSarif(project, alertId, repository, ref, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + alertId: alertId, + repository: repository + }; + let queryValues = { + ref: ref, + expand: expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "e21b4630-b7d2-4031-99e3-3ad328cc4a7f", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Update the status of an alert + * + * @param {AlertInterfaces.AlertStateUpdate} stateUpdate - The new status of the alert + * @param {string} project - Project ID or project name + * @param {number} alertId - The ID of the alert + * @param {string} repository - The name or ID of the repository + */ + updateAlert(stateUpdate, project, alertId, repository) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + alertId: alertId, + repository: repository + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "e21b4630-b7d2-4031-99e3-3ad328cc4a7f", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, stateUpdate, options); + let ret = this.formatResponse(res.result, AlertInterfaces.TypeInfo.Alert, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns the branches for which analysis results were submitted. + * + * @param {string} project - Project ID or project name + * @param {string} repository + * @param {AlertInterfaces.AlertType} alertType - The type of alert: Dependency Scanning (1), Secret (2), Code QL (3), etc. + * @param {string} continuationToken - A string variable that represents the branch name and is used to fetch branches that follow it in alphabetical order. + * @param {string} branchNameContains - A string variable used to fetch branches that contain this string anywhere in the branch name, case insensitive. + * @param {number} top - An int variable used to return the top k branches that satisfy the search criteria. + * @param {boolean} includePullRequestBranches - A bool variable indicating whether or not to include pull request branches. + */ + getBranches(project, repository, alertType, continuationToken, branchNameContains, top, includePullRequestBranches) { + return __awaiter(this, void 0, void 0, function* () { + if (alertType == null) { + throw new TypeError('alertType can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + action: "Branches", + project: project, + repository: repository + }; + let queryValues = { + alertType: alertType, + continuationToken: continuationToken, + branchNameContains: branchNameContains, + top: top, + includePullRequestBranches: includePullRequestBranches, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "8f90675b-f794-434d-8f2c-cfae0a11c02a", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, AlertInterfaces.TypeInfo.Branch, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {string} project - Project ID or project name + * @param {string} repository + * @param {AlertInterfaces.AlertType} alertType + */ + getUxFilters(project, repository, alertType) { + return __awaiter(this, void 0, void 0, function* () { + if (alertType == null) { + throw new TypeError('alertType can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + action: "Default", + project: project, + repository: repository + }; + let queryValues = { + alertType: alertType, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "8f90675b-f794-434d-8f2c-cfae0a11c02a", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, AlertInterfaces.TypeInfo.UxFilters, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get instances of an alert on a branch specified with @ref. If @ref is not provided, return instances of an alert on default branch(if the alert exist in default branch) or latest affected branch. + * + * @param {string} project - Project ID or project name + * @param {number} alertId - ID of alert to retrieve + * @param {string} repository - Name or id of a repository that alert is part of + * @param {string} ref + */ + getAlertInstances(project, alertId, repository, ref) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + alertId: alertId, + repository: repository + }; + let queryValues = { + ref: ref, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "f451ba96-0e95-458a-8dd5-3df894770a49", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, AlertInterfaces.TypeInfo.AlertAnalysisInstance, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Create legal review. This creates the legal review associated with the alert. It include the review work item url. + * + * @param {string} project - Project ID or project name + * @param {string} repository - Name or id of a repository for the legal alert + * @param {number} alertId - Advance Security alert id of the legal alert to get the legal review + * @param {string} ref + */ + createLegalReview(project, repository, alertId, ref) { + return __awaiter(this, void 0, void 0, function* () { + if (alertId == null) { + throw new TypeError('alertId can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repository: repository + }; + let queryValues = { + alertId: alertId, + ref: ref, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "65de4b84-7519-4ae8-8623-175f79b49b80", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Update alert metadata associations. + * + * @param {AlertInterfaces.AlertMetadata[]} alertsMetadata - A list of metadata to associate with alerts. + * @param {string} project - Project ID or project name + * @param {string} repository - The name or ID of the repository. + */ + updateAlertsMetadata(alertsMetadata, project, repository) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repository: repository + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "65de4b84-7519-4ae8-8623-175f79b49b80", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, alertsMetadata, options); + let ret = this.formatResponse(res.result, AlertInterfaces.TypeInfo.AlertMetadataChange, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Upload a Sarif containing security alerts + * + * @param {NodeJS.ReadableStream} contentStream - Content to upload + * @param {string} project - Project ID or project name + * @param {string} repository - The name or ID of a repository + * @param {String} notificationFlag - Header to signal that this is a progress notification + */ + uploadSarif(customHeaders, contentStream, project, repository, notificationFlag) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repository: repository + }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "application/octet-stream"; + customHeaders["X-AdvSec-NotificationSarif"] = "notificationFlag"; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "2a141cae-a50d-4c22-b41b-13f77748d035", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; + let res; + res = yield this.rest.uploadStream("POST", url, contentStream, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get the status of the Sarif processing job + * + * @param {number} sarifId - Sarif ID returned when the Sarif was uploaded + */ + getSarif(sarifId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + sarifId: sarifId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Alert", "a04689e7-0f81-48a2-8d18-40654c47494c", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, AlertInterfaces.TypeInfo.SarifUploadStatus, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get the validity details for an alert. + * + * @param {string} project - Project ID or project name + * @param {string} repository - The name or ID of a repository + * @param {number} alertId - The ID of the alert + */ + getValidityData(project, repository, alertId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repository: repository, + alertId: alertId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "2e022520-3508-4b5f-9855-acb954d673ba", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, AlertInterfaces.TypeInfo.ValidationRequestInfo, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Initiate the validation process for a given alert + * + * @param {string} project - Project ID or project name + * @param {string} repository - The name or ID of a repository + * @param {number} alertId - The ID of the alert + */ + initiateValidation(project, repository, alertId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repository: repository, + alertId: alertId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Alert", "2e022520-3508-4b5f-9855-acb954d673ba", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, AlertInterfaces.TypeInfo.AlertValidationRequestStatus, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } +} +exports.AlertApi = AlertApi; + + /***/ }), /***/ 9893: @@ -2364,19 +2844,21 @@ exports.checkBypass = checkBypass; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BuildApi = void 0; const basem = __nccwpck_require__(273); const BuildInterfaces = __nccwpck_require__(2167); class BuildApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Build-api', options); + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Build-api', options); } /** * Associates an artifact with a build. @@ -2393,7 +2875,7 @@ class BuildApi extends basem.ClientApiBase { buildId: buildId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.5", "build", "1db06c96-014e-44e1-ac91-90b2d4b3e984", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.5", "build", "1db06c96-014e-44e1-ac91-90b2d4b3e984", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2428,7 +2910,7 @@ class BuildApi extends basem.ClientApiBase { artifactName: artifactName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.5", "build", "1db06c96-014e-44e1-ac91-90b2d4b3e984", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.5", "build", "1db06c96-014e-44e1-ac91-90b2d4b3e984", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2463,7 +2945,7 @@ class BuildApi extends basem.ClientApiBase { artifactName: artifactName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.5", "build", "1db06c96-014e-44e1-ac91-90b2d4b3e984", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.5", "build", "1db06c96-014e-44e1-ac91-90b2d4b3e984", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/zip", apiVersion); @@ -2489,7 +2971,7 @@ class BuildApi extends basem.ClientApiBase { buildId: buildId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.5", "build", "1db06c96-014e-44e1-ac91-90b2d4b3e984", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.5", "build", "1db06c96-014e-44e1-ac91-90b2d4b3e984", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2534,7 +3016,7 @@ class BuildApi extends basem.ClientApiBase { fileName: fileName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.5", "build", "1db06c96-014e-44e1-ac91-90b2d4b3e984", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.5", "build", "1db06c96-014e-44e1-ac91-90b2d4b3e984", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -2562,7 +3044,7 @@ class BuildApi extends basem.ClientApiBase { type: type }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "f2192269-89fa-4f94-baf6-8fb128c55159", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "f2192269-89fa-4f94-baf6-8fb128c55159", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2598,7 +3080,7 @@ class BuildApi extends basem.ClientApiBase { name: name }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "af5122d3-3438-485e-a25a-2dbbfde84ee6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "af5122d3-3438-485e-a25a-2dbbfde84ee6", routeValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -2621,7 +3103,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "398c85bc-81aa-4822-947c-a194a05f0fef", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "398c85bc-81aa-4822-947c-a194a05f0fef", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2651,7 +3133,7 @@ class BuildApi extends basem.ClientApiBase { id: id, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "398c85bc-81aa-4822-947c-a194a05f0fef", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "398c85bc-81aa-4822-947c-a194a05f0fef", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2683,7 +3165,7 @@ class BuildApi extends basem.ClientApiBase { branchName: branchName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "de6a4df8-22cd-44ee-af2d-39f6aa7a4261", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "de6a4df8-22cd-44ee-af2d-39f6aa7a4261", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2719,7 +3201,7 @@ class BuildApi extends basem.ClientApiBase { branchName: branchName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "e05d4403-9b81-4244-8763-20fde28d1976", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "e05d4403-9b81-4244-8763-20fde28d1976", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2753,7 +3235,7 @@ class BuildApi extends basem.ClientApiBase { branchName: branchName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "21b3b9ce-fad5-4567-9ad0-80679794e003", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "21b3b9ce-fad5-4567-9ad0-80679794e003", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2787,7 +3269,7 @@ class BuildApi extends basem.ClientApiBase { branchName: branchName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "21b3b9ce-fad5-4567-9ad0-80679794e003", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "21b3b9ce-fad5-4567-9ad0-80679794e003", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2801,6 +3283,34 @@ class BuildApi extends basem.ClientApiBase { })); }); } + /** + * Gets all retention leases that apply to a specific build. + * + * @param {string} project - Project ID or project name + * @param {number} buildId - The ID of the build. + */ + getRetentionLeasesForBuild(project, buildId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + buildId: buildId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "3da19a6a-f088-45c4-83ce-2ad3a87be6c4", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, BuildInterfaces.TypeInfo.RetentionLease, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** * Deletes a build. * @@ -2815,7 +3325,7 @@ class BuildApi extends basem.ClientApiBase { buildId: buildId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2847,7 +3357,7 @@ class BuildApi extends basem.ClientApiBase { propertyFilters: propertyFilters, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2915,7 +3425,7 @@ class BuildApi extends basem.ClientApiBase { repositoryType: repositoryType, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2952,7 +3462,7 @@ class BuildApi extends basem.ClientApiBase { definitionId: definitionId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -2985,7 +3495,7 @@ class BuildApi extends basem.ClientApiBase { retry: retry, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3012,7 +3522,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "0cd358e1-9217-4d94-8269-1c1ee6f93dcf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3048,7 +3558,7 @@ class BuildApi extends basem.ClientApiBase { includeSourceChange: includeSourceChange, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "54572c7b-bbd3-45d4-80dc-28be08941620", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "54572c7b-bbd3-45d4-80dc-28be08941620", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3082,7 +3592,7 @@ class BuildApi extends basem.ClientApiBase { '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "f10f0ea5-18a1-43ec-a8fb-2042c7be9b43", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "f10f0ea5-18a1-43ec-a8fb-2042c7be9b43", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3108,7 +3618,7 @@ class BuildApi extends basem.ClientApiBase { controllerId: controllerId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "fcac1932-2ee1-437f-9b6f-7f696be858f6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "fcac1932-2ee1-437f-9b6f-7f696be858f6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3135,7 +3645,7 @@ class BuildApi extends basem.ClientApiBase { name: name, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "fcac1932-2ee1-437f-9b6f-7f696be858f6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "fcac1932-2ee1-437f-9b6f-7f696be858f6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3168,7 +3678,7 @@ class BuildApi extends basem.ClientApiBase { definitionToCloneRevision: definitionToCloneRevision, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3196,7 +3706,7 @@ class BuildApi extends basem.ClientApiBase { definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3234,7 +3744,7 @@ class BuildApi extends basem.ClientApiBase { includeLatestBuilds: includeLatestBuilds, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3267,7 +3777,7 @@ class BuildApi extends basem.ClientApiBase { * @param {boolean} includeLatestBuilds - Indicates whether to return the latest and latest completed builds for this definition. * @param {string} taskIdFilter - If specified, filters to definitions that use the specified task. * @param {number} processType - If specified, filters to definitions with the given process type. - * @param {string} yamlFilename - If specified, filters to YAML definitions that match the given filename. + * @param {string} yamlFilename - If specified, filters to YAML definitions that match the given filename. To use this filter includeAllProperties should be set to true */ getDefinitions(project, name, repositoryId, repositoryType, queryOrder, top, continuationToken, minMetricsTime, definitionIds, path, builtAfter, notBuiltAfter, includeAllProperties, includeLatestBuilds, taskIdFilter, processType, yamlFilename) { return __awaiter(this, void 0, void 0, function* () { @@ -3294,7 +3804,7 @@ class BuildApi extends basem.ClientApiBase { yamlFilename: yamlFilename, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3329,7 +3839,7 @@ class BuildApi extends basem.ClientApiBase { deleted: deleted, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3364,7 +3874,7 @@ class BuildApi extends basem.ClientApiBase { secretsSourceDefinitionRevision: secretsSourceDefinitionRevision, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.7", "build", "dbeaf647-6167-421a-bda9-c9327b25e2e6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3402,7 +3912,7 @@ class BuildApi extends basem.ClientApiBase { path: path, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "29d12225-b1d9-425f-b668-6c594a981313", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "29d12225-b1d9-425f-b668-6c594a981313", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("text/plain", apiVersion); @@ -3434,7 +3944,7 @@ class BuildApi extends basem.ClientApiBase { path: path, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "a906531b-d2da-4f55-bda7-f3e676cc50d9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "a906531b-d2da-4f55-bda7-f3e676cc50d9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3467,7 +3977,7 @@ class BuildApi extends basem.ClientApiBase { path: path, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "a906531b-d2da-4f55-bda7-f3e676cc50d9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "a906531b-d2da-4f55-bda7-f3e676cc50d9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3499,7 +4009,7 @@ class BuildApi extends basem.ClientApiBase { queryOrder: queryOrder, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "a906531b-d2da-4f55-bda7-f3e676cc50d9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "a906531b-d2da-4f55-bda7-f3e676cc50d9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3533,7 +4043,7 @@ class BuildApi extends basem.ClientApiBase { path: path, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "a906531b-d2da-4f55-bda7-f3e676cc50d9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "a906531b-d2da-4f55-bda7-f3e676cc50d9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3559,7 +4069,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "c4aefd19-30ff-405b-80ad-aca021e7242a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "c4aefd19-30ff-405b-80ad-aca021e7242a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3586,7 +4096,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "c4aefd19-30ff-405b-80ad-aca021e7242a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "c4aefd19-30ff-405b-80ad-aca021e7242a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3613,7 +4123,7 @@ class BuildApi extends basem.ClientApiBase { daysToLookback: daysToLookback, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "1a9c48be-0ef5-4ec2-b94f-f053bdd2d3bf", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "1a9c48be-0ef5-4ec2-b94f-f053bdd2d3bf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3645,7 +4155,7 @@ class BuildApi extends basem.ClientApiBase { branchName: branchName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "54481611-01f4-47f3-998f-160da0f0c229", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "54481611-01f4-47f3-998f-160da0f0c229", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3672,7 +4182,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3705,7 +4215,7 @@ class BuildApi extends basem.ClientApiBase { ids: ids && ids.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3733,7 +4243,7 @@ class BuildApi extends basem.ClientApiBase { leaseId: leaseId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3766,7 +4276,7 @@ class BuildApi extends basem.ClientApiBase { leasesToFetch: leasesToFetch && leasesToFetch.join("|"), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3800,7 +4310,7 @@ class BuildApi extends basem.ClientApiBase { runId: runId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3837,7 +4347,7 @@ class BuildApi extends basem.ClientApiBase { runId: runId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3851,6 +4361,35 @@ class BuildApi extends basem.ClientApiBase { })); }); } + /** + * Updates the duration or pipeline protection status of a retention lease. + * + * @param {BuildInterfaces.RetentionLeaseUpdate} leaseUpdate - The new data for the retention lease. + * @param {string} project - Project ID or project name + * @param {number} leaseId - The ID of the lease to update. + */ + updateRetentionLease(leaseUpdate, project, leaseId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + leaseId: leaseId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "272051e4-9af1-45b5-ae22-8d960a5539d4", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, leaseUpdate, options); + let ret = this.formatResponse(res.result, BuildInterfaces.TypeInfo.RetentionLease, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** * Gets an individual log file for a build. * @@ -3873,7 +4412,7 @@ class BuildApi extends basem.ClientApiBase { endLine: endLine, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "35a80daf-7f30-45fc-86e8-6b813d9c90df", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "35a80daf-7f30-45fc-86e8-6b813d9c90df", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("text/plain", apiVersion); @@ -3907,7 +4446,7 @@ class BuildApi extends basem.ClientApiBase { endLine: endLine, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "35a80daf-7f30-45fc-86e8-6b813d9c90df", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "35a80daf-7f30-45fc-86e8-6b813d9c90df", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3935,7 +4474,7 @@ class BuildApi extends basem.ClientApiBase { buildId: buildId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "35a80daf-7f30-45fc-86e8-6b813d9c90df", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "35a80daf-7f30-45fc-86e8-6b813d9c90df", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -3963,7 +4502,7 @@ class BuildApi extends basem.ClientApiBase { buildId: buildId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "35a80daf-7f30-45fc-86e8-6b813d9c90df", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "35a80daf-7f30-45fc-86e8-6b813d9c90df", routeValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/zip", apiVersion); @@ -3997,7 +4536,7 @@ class BuildApi extends basem.ClientApiBase { endLine: endLine, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "35a80daf-7f30-45fc-86e8-6b813d9c90df", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "35a80daf-7f30-45fc-86e8-6b813d9c90df", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/zip", apiVersion); @@ -4027,7 +4566,7 @@ class BuildApi extends basem.ClientApiBase { minMetricsTime: minMetricsTime, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "7433fae7-a6bc-41dc-a6e2-eef9005ce41a", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "7433fae7-a6bc-41dc-a6e2-eef9005ce41a", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4059,7 +4598,7 @@ class BuildApi extends basem.ClientApiBase { minMetricsTime: minMetricsTime, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "d973b939-0ce0-4fec-91d8-da3940fa1827", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "d973b939-0ce0-4fec-91d8-da3940fa1827", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4085,7 +4624,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "591cb5a4-2d46-4f3a-a697-5cd42b6bd332", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "591cb5a4-2d46-4f3a-a697-5cd42b6bd332", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4123,7 +4662,7 @@ class BuildApi extends basem.ClientApiBase { path: path, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "7944d6fb-df01-4709-920a-7a189aa34037", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "7944d6fb-df01-4709-920a-7a189aa34037", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4155,7 +4694,7 @@ class BuildApi extends basem.ClientApiBase { filter: filter && filter.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "0a6312e9-0627-49b7-8083-7d74a64849c9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "0a6312e9-0627-49b7-8083-7d74a64849c9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4186,7 +4725,7 @@ class BuildApi extends basem.ClientApiBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/json-patch+json"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "0a6312e9-0627-49b7-8083-7d74a64849c9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "0a6312e9-0627-49b7-8083-7d74a64849c9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -4219,7 +4758,7 @@ class BuildApi extends basem.ClientApiBase { filter: filter && filter.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "d9826ad7-2a68-46a9-a6e9-677698777895", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "d9826ad7-2a68-46a9-a6e9-677698777895", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4250,7 +4789,7 @@ class BuildApi extends basem.ClientApiBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/json-patch+json"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "d9826ad7-2a68-46a9-a6e9-677698777895", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "d9826ad7-2a68-46a9-a6e9-677698777895", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -4287,7 +4826,7 @@ class BuildApi extends basem.ClientApiBase { serviceEndpointId: serviceEndpointId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "d8763ec7-9ff0-4fb4-b2b2-9d757906ff14", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "d8763ec7-9ff0-4fb4-b2b2-9d757906ff14", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4319,7 +4858,7 @@ class BuildApi extends basem.ClientApiBase { type: type, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "45bcaa88-67e1-4042-a035-56d3b4a7d44c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "45bcaa88-67e1-4042-a035-56d3b4a7d44c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4351,7 +4890,7 @@ class BuildApi extends basem.ClientApiBase { type: type, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "45bcaa88-67e1-4042-a035-56d3b4a7d44c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "45bcaa88-67e1-4042-a035-56d3b4a7d44c", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("text/html", apiVersion); @@ -4389,7 +4928,7 @@ class BuildApi extends basem.ClientApiBase { continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "d44d1680-f978-4834-9b93-8c6e132329c9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "d44d1680-f978-4834-9b93-8c6e132329c9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4416,7 +4955,7 @@ class BuildApi extends basem.ClientApiBase { definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "ea623316-1967-45eb-89ab-e9e6110cf2d6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "ea623316-1967-45eb-89ab-e9e6110cf2d6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4442,7 +4981,7 @@ class BuildApi extends basem.ClientApiBase { definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "ea623316-1967-45eb-89ab-e9e6110cf2d6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "ea623316-1967-45eb-89ab-e9e6110cf2d6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4465,7 +5004,7 @@ class BuildApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "3813d06c-9e36-4ea1-aac3-61a485d60e3d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "3813d06c-9e36-4ea1-aac3-61a485d60e3d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4491,7 +5030,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "dadb46e7-5851-4c72-820e-ae8abb82f59f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "dadb46e7-5851-4c72-820e-ae8abb82f59f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4518,7 +5057,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "dadb46e7-5851-4c72-820e-ae8abb82f59f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "dadb46e7-5851-4c72-820e-ae8abb82f59f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4546,7 +5085,7 @@ class BuildApi extends basem.ClientApiBase { definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "7c116775-52e5-453e-8c5d-914d9762d8c4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "7c116775-52e5-453e-8c5d-914d9762d8c4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4572,7 +5111,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4599,7 +5138,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4625,7 +5164,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "3ce81729-954f-423d-a581-9fea01d25186", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "3ce81729-954f-423d-a581-9fea01d25186", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4656,7 +5195,7 @@ class BuildApi extends basem.ClientApiBase { stageRefName: stageRefName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "b8aac6c9-744b-46e1-88fc-3550969f9313", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "b8aac6c9-744b-46e1-88fc-3550969f9313", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4696,7 +5235,7 @@ class BuildApi extends basem.ClientApiBase { label: label, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "07acfdce-4757-4439-b422-ddd13a2fcc10", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "07acfdce-4757-4439-b422-ddd13a2fcc10", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4726,7 +5265,7 @@ class BuildApi extends basem.ClientApiBase { tag: tag }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "6e6114b2-8161-44c8-8f6c-c5505782427f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "6e6114b2-8161-44c8-8f6c-c5505782427f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4743,7 +5282,7 @@ class BuildApi extends basem.ClientApiBase { /** * Adds tags to a build. * - * @param {string[]} tags - The tags to add. + * @param {string[]} tags - The tags to add. Request body is composed directly from listed tags. * @param {string} project - Project ID or project name * @param {number} buildId - The ID of the build. */ @@ -4755,7 +5294,7 @@ class BuildApi extends basem.ClientApiBase { buildId: buildId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "6e6114b2-8161-44c8-8f6c-c5505782427f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "6e6114b2-8161-44c8-8f6c-c5505782427f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4785,7 +5324,7 @@ class BuildApi extends basem.ClientApiBase { tag: tag }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "6e6114b2-8161-44c8-8f6c-c5505782427f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "6e6114b2-8161-44c8-8f6c-c5505782427f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4813,7 +5352,7 @@ class BuildApi extends basem.ClientApiBase { buildId: buildId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "6e6114b2-8161-44c8-8f6c-c5505782427f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "6e6114b2-8161-44c8-8f6c-c5505782427f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4842,7 +5381,7 @@ class BuildApi extends basem.ClientApiBase { buildId: buildId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "6e6114b2-8161-44c8-8f6c-c5505782427f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "6e6114b2-8161-44c8-8f6c-c5505782427f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4872,7 +5411,7 @@ class BuildApi extends basem.ClientApiBase { tag: tag }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "cb894432-134a-4d31-a839-83beceaace4b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "cb894432-134a-4d31-a839-83beceaace4b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4901,7 +5440,7 @@ class BuildApi extends basem.ClientApiBase { definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "cb894432-134a-4d31-a839-83beceaace4b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "cb894432-134a-4d31-a839-83beceaace4b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4931,7 +5470,7 @@ class BuildApi extends basem.ClientApiBase { tag: tag }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "cb894432-134a-4d31-a839-83beceaace4b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "cb894432-134a-4d31-a839-83beceaace4b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4963,7 +5502,7 @@ class BuildApi extends basem.ClientApiBase { revision: revision, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "cb894432-134a-4d31-a839-83beceaace4b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "cb894432-134a-4d31-a839-83beceaace4b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -4992,7 +5531,7 @@ class BuildApi extends basem.ClientApiBase { definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "cb894432-134a-4d31-a839-83beceaace4b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "cb894432-134a-4d31-a839-83beceaace4b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5020,7 +5559,7 @@ class BuildApi extends basem.ClientApiBase { tag: tag }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "d84ac5c6-edc7-43d5-adc9-1b34be5dea09", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "d84ac5c6-edc7-43d5-adc9-1b34be5dea09", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5046,7 +5585,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "d84ac5c6-edc7-43d5-adc9-1b34be5dea09", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "d84ac5c6-edc7-43d5-adc9-1b34be5dea09", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5074,7 +5613,7 @@ class BuildApi extends basem.ClientApiBase { templateId: templateId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "e884571e-7f92-4d6a-9274-3f5649900835", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "e884571e-7f92-4d6a-9274-3f5649900835", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5102,7 +5641,7 @@ class BuildApi extends basem.ClientApiBase { templateId: templateId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "e884571e-7f92-4d6a-9274-3f5649900835", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "e884571e-7f92-4d6a-9274-3f5649900835", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5128,7 +5667,7 @@ class BuildApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "e884571e-7f92-4d6a-9274-3f5649900835", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "e884571e-7f92-4d6a-9274-3f5649900835", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5157,7 +5696,7 @@ class BuildApi extends basem.ClientApiBase { templateId: templateId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "build", "e884571e-7f92-4d6a-9274-3f5649900835", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "e884571e-7f92-4d6a-9274-3f5649900835", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5193,7 +5732,7 @@ class BuildApi extends basem.ClientApiBase { planId: planId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "8baac422-4c6e-4de5-8532-db96d92acffa", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "build", "8baac422-4c6e-4de5-8532-db96d92acffa", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5228,7 +5767,7 @@ class BuildApi extends basem.ClientApiBase { repository: repository, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "793bceb8-9736-4030-bd2f-fb3ce6d6b478", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "793bceb8-9736-4030-bd2f-fb3ce6d6b478", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5262,7 +5801,7 @@ class BuildApi extends basem.ClientApiBase { repository: repository, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "8f20ff82-9498-4812-9f6e-9c01bdc50e99", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "8f20ff82-9498-4812-9f6e-9c01bdc50e99", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5294,7 +5833,7 @@ class BuildApi extends basem.ClientApiBase { '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "5a21f5d2-5642-47e4-a0bd-1356e6731bee", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "5a21f5d2-5642-47e4-a0bd-1356e6731bee", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5327,7 +5866,7 @@ class BuildApi extends basem.ClientApiBase { '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "5a21f5d2-5642-47e4-a0bd-1356e6731bee", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "5a21f5d2-5642-47e4-a0bd-1356e6731bee", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5367,7 +5906,7 @@ class BuildApi extends basem.ClientApiBase { '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "build", "52ba8915-5518-42e3-a4bb-b0182d159e2d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "build", "52ba8915-5518-42e3-a4bb-b0182d159e2d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5405,7 +5944,7 @@ class BuildApi extends basem.ClientApiBase { includeLatestBuilds: includeLatestBuilds, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "build", "7c3df3a1-7e51-4150-8cf7-540347f8697f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "build", "7c3df3a1-7e51-4150-8cf7-540347f8697f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5420,8 +5959,174 @@ class BuildApi extends basem.ClientApiBase { }); } } -BuildApi.RESOURCE_AREA_ID = "965220d5-5bb9-42cf-8d67-9b146df2a5a4"; exports.BuildApi = BuildApi; +BuildApi.RESOURCE_AREA_ID = "965220d5-5bb9-42cf-8d67-9b146df2a5a4"; + + +/***/ }), + +/***/ 463: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CixApi = void 0; +const basem = __nccwpck_require__(273); +class CixApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Pipelines-api', options); + } + /** + * Gets a list of existing configuration files for the given repository. + * + * @param {string} project - Project ID or project name + * @param {string} repositoryType - The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc. + * @param {string} repositoryId - The vendor-specific identifier or the name of the repository, e.g. Microsoft/vscode (GitHub) or e9d82045-ddba-4e01-a63d-2ab9f040af62 (Azure Repos) + * @param {string} branch - The repository branch where to look for the configuration file. + * @param {string} serviceConnectionId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TfsGit (i.e. Azure Repos). + */ + getConfigurations(project, repositoryType, repositoryId, branch, serviceConnectionId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + repositoryType: repositoryType, + repositoryId: repositoryId, + branch: branch, + serviceConnectionId: serviceConnectionId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "8fc87684-9ebc-4c37-ab92-f4ac4a58cb3a", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a new Pipeline connection between the provider installation and the specified project. Returns the PipelineConnection object created. + * + * @param {CIXInterfaces.CreatePipelineConnectionInputs} createConnectionInputs + * @param {string} project + */ + createProjectConnection(createConnectionInputs, project) { + return __awaiter(this, void 0, void 0, function* () { + if (project == null) { + throw new TypeError('project can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + project: project, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "00df4879-9216-45d5-b38d-4a487b626b2c", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, createConnectionInputs, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of build frameworks that best match the given repository based on its contents. + * + * @param {string} project - Project ID or project name + * @param {string} repositoryType - The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc. + * @param {string} repositoryId - The vendor-specific identifier or the name of the repository, e.g. Microsoft/vscode (GitHub) or e9d82045-ddba-4e01-a63d-2ab9f040af62 (Azure Repos) + * @param {string} branch - The repository branch to detect build frameworks for. + * @param {CIXInterfaces.BuildFrameworkDetectionType} detectionType + * @param {string} serviceConnectionId - If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TfsGit (i.e. Azure Repos). + */ + getDetectedBuildFrameworks(project, repositoryType, repositoryId, branch, detectionType, serviceConnectionId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + repositoryType: repositoryType, + repositoryId: repositoryId, + branch: branch, + detectionType: detectionType, + serviceConnectionId: serviceConnectionId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "29a30bab-9efb-4652-bf1b-9269baca0980", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {{ [key: string] : CIXInterfaces.ResourceCreationParameter; }} creationParameters + * @param {string} project - Project ID or project name + */ + createResources(creationParameters, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "43201899-7690-4870-9c79-ab69605f21ed", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, creationParameters, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } +} +exports.CixApi = CixApi; /***/ }), @@ -5434,6 +6139,7 @@ exports.BuildApi = BuildApi; // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ClientApiBase = void 0; const vsom = __nccwpck_require__(9686); const serm = __nccwpck_require__(5817); const rm = __nccwpck_require__(7405); @@ -5483,20 +6189,22 @@ exports.ClientApiBase = ClientApiBase; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CoreApi = void 0; const basem = __nccwpck_require__(273); const CoreInterfaces = __nccwpck_require__(3931); const OperationsInterfaces = __nccwpck_require__(3052); class CoreApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Core-api', options); + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Core-api', options); } /** * Removes the avatar for the project. @@ -5510,7 +6218,7 @@ class CoreApi extends basem.ClientApiBase { projectId: projectId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "54b2a2a0-859b-4d05-827c-ec4c862f641a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "54b2a2a0-859b-4d05-827c-ec4c862f641a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5537,7 +6245,7 @@ class CoreApi extends basem.ClientApiBase { projectId: projectId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "54b2a2a0-859b-4d05-827c-ec4c862f641a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "54b2a2a0-859b-4d05-827c-ec4c862f641a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5551,6 +6259,40 @@ class CoreApi extends basem.ClientApiBase { })); }); } + /** + * Gets list of user readable teams in a project and teams user is member of (excluded from readable list). + * + * @param {string} projectId - The name or ID (GUID) of the team project containing the teams to retrieve. + * @param {boolean} expandIdentity - A value indicating whether or not to expand Identity information in the result WebApiTeam object. + * @param {number} top - Maximum number of teams to return. + * @param {number} skip - Number of teams to skip. + */ + getProjectTeamsByCategory(projectId, expandIdentity, top, skip) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + projectId: projectId + }; + let queryValues = { + '$expandIdentity': expandIdentity, + '$top': top, + '$skip': skip, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "6f9619ff-8b86-d011-b42d-00c04fc964ff", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** * @param {CoreInterfaces.WebApiConnectedServiceDetails} connectedServiceCreationData * @param {string} projectId @@ -5562,7 +6304,7 @@ class CoreApi extends basem.ClientApiBase { projectId: projectId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "b4f70219-e18b-42c5-abe3-98b07d35525e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "b4f70219-e18b-42c5-abe3-98b07d35525e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5588,7 +6330,7 @@ class CoreApi extends basem.ClientApiBase { name: name }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "b4f70219-e18b-42c5-abe3-98b07d35525e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "b4f70219-e18b-42c5-abe3-98b07d35525e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5616,7 +6358,7 @@ class CoreApi extends basem.ClientApiBase { kind: kind, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "b4f70219-e18b-42c5-abe3-98b07d35525e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "b4f70219-e18b-42c5-abe3-98b07d35525e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5641,7 +6383,7 @@ class CoreApi extends basem.ClientApiBase { mruName: mruName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "5ead0b70-2572-4697-97e9-f341069a783a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "5ead0b70-2572-4697-97e9-f341069a783a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5666,7 +6408,7 @@ class CoreApi extends basem.ClientApiBase { mruName: mruName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "5ead0b70-2572-4697-97e9-f341069a783a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "5ead0b70-2572-4697-97e9-f341069a783a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5690,7 +6432,7 @@ class CoreApi extends basem.ClientApiBase { mruName: mruName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "5ead0b70-2572-4697-97e9-f341069a783a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "5ead0b70-2572-4697-97e9-f341069a783a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5715,7 +6457,7 @@ class CoreApi extends basem.ClientApiBase { mruName: mruName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "5ead0b70-2572-4697-97e9-f341069a783a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "5ead0b70-2572-4697-97e9-f341069a783a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5749,7 +6491,7 @@ class CoreApi extends basem.ClientApiBase { '$skip': skip, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "core", "294c494c-2600-4d7e-b76c-3dd50c3c95be", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "core", "294c494c-2600-4d7e-b76c-3dd50c3c95be", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5775,7 +6517,7 @@ class CoreApi extends basem.ClientApiBase { processId: processId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "93878975-88c5-4e6a-8abb-7ddd77a8a7d8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "93878975-88c5-4e6a-8abb-7ddd77a8a7d8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5798,7 +6540,7 @@ class CoreApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "93878975-88c5-4e6a-8abb-7ddd77a8a7d8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "93878975-88c5-4e6a-8abb-7ddd77a8a7d8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5824,7 +6566,7 @@ class CoreApi extends basem.ClientApiBase { collectionId: collectionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "core", "8031090f-ef1d-4af6-85fc-698cd75d42bf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "core", "8031090f-ef1d-4af6-85fc-698cd75d42bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5853,7 +6595,7 @@ class CoreApi extends basem.ClientApiBase { '$skip': skip, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "core", "8031090f-ef1d-4af6-85fc-698cd75d42bf", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "core", "8031090f-ef1d-4af6-85fc-698cd75d42bf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5880,7 +6622,7 @@ class CoreApi extends basem.ClientApiBase { minRevision: minRevision, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "core", "6488a877-4749-4954-82ea-7340d36be9f2", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "core", "6488a877-4749-4954-82ea-7340d36be9f2", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5912,7 +6654,7 @@ class CoreApi extends basem.ClientApiBase { includeHistory: includeHistory, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "core", "603fe2ac-9723-48b9-88ad-09305aa6c6e1", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "core", "603fe2ac-9723-48b9-88ad-09305aa6c6e1", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5932,7 +6674,7 @@ class CoreApi extends basem.ClientApiBase { * @param {any} stateFilter - Filter on team projects in a specific team project state (default: WellFormed). * @param {number} top * @param {number} skip - * @param {string} continuationToken + * @param {number} continuationToken - Pointer that shows how many projects already been fetched. * @param {boolean} getDefaultTeamImageUrl */ getProjects(stateFilter, top, skip, continuationToken, getDefaultTeamImageUrl) { @@ -5947,7 +6689,7 @@ class CoreApi extends basem.ClientApiBase { getDefaultTeamImageUrl: getDefaultTeamImageUrl, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "core", "603fe2ac-9723-48b9-88ad-09305aa6c6e1", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "core", "603fe2ac-9723-48b9-88ad-09305aa6c6e1", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5971,7 +6713,7 @@ class CoreApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "core", "603fe2ac-9723-48b9-88ad-09305aa6c6e1", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "core", "603fe2ac-9723-48b9-88ad-09305aa6c6e1", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -5997,7 +6739,7 @@ class CoreApi extends basem.ClientApiBase { projectId: projectId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "core", "603fe2ac-9723-48b9-88ad-09305aa6c6e1", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "core", "603fe2ac-9723-48b9-88ad-09305aa6c6e1", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6024,7 +6766,7 @@ class CoreApi extends basem.ClientApiBase { projectId: projectId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "core", "603fe2ac-9723-48b9-88ad-09305aa6c6e1", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "core", "603fe2ac-9723-48b9-88ad-09305aa6c6e1", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6056,7 +6798,7 @@ class CoreApi extends basem.ClientApiBase { properties: properties && properties.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "0a3ffdfc-fe94-47a6-bb27-79bf3f762eac", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "0a3ffdfc-fe94-47a6-bb27-79bf3f762eac", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6086,7 +6828,7 @@ class CoreApi extends basem.ClientApiBase { keys: keys && keys.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "4976a71a-4487-49aa-8aab-a1eda469037a", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "4976a71a-4487-49aa-8aab-a1eda469037a", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6115,7 +6857,7 @@ class CoreApi extends basem.ClientApiBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/json-patch+json"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "core", "4976a71a-4487-49aa-8aab-a1eda469037a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "core", "4976a71a-4487-49aa-8aab-a1eda469037a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -6138,7 +6880,7 @@ class CoreApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "core", "ec1f4311-f2b4-4c15-b2b8-8990b80d2908", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "core", "ec1f4311-f2b4-4c15-b2b8-8990b80d2908", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6168,7 +6910,7 @@ class CoreApi extends basem.ClientApiBase { site: site, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "core", "ec1f4311-f2b4-4c15-b2b8-8990b80d2908", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "core", "ec1f4311-f2b4-4c15-b2b8-8990b80d2908", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6193,7 +6935,7 @@ class CoreApi extends basem.ClientApiBase { proxyUrl: proxyUrl, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "core", "ec1f4311-f2b4-4c15-b2b8-8990b80d2908", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "core", "ec1f4311-f2b4-4c15-b2b8-8990b80d2908", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6226,7 +6968,7 @@ class CoreApi extends basem.ClientApiBase { '$expandIdentity': expandIdentity, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "core", "7a4d9ee9-3433-4347-b47a-7a80f1cf307e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "core", "7a4d9ee9-3433-4347-b47a-7a80f1cf307e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6253,7 +6995,7 @@ class CoreApi extends basem.ClientApiBase { projectId: projectId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "core", "d30a3dd1-f8ba-442a-b86a-bd0c0c383e59", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "core", "d30a3dd1-f8ba-442a-b86a-bd0c0c383e59", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6281,7 +7023,7 @@ class CoreApi extends basem.ClientApiBase { teamId: teamId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "core", "d30a3dd1-f8ba-442a-b86a-bd0c0c383e59", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "core", "d30a3dd1-f8ba-442a-b86a-bd0c0c383e59", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6313,7 +7055,7 @@ class CoreApi extends basem.ClientApiBase { '$expandIdentity': expandIdentity, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "core", "d30a3dd1-f8ba-442a-b86a-bd0c0c383e59", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "core", "d30a3dd1-f8ba-442a-b86a-bd0c0c383e59", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6349,7 +7091,7 @@ class CoreApi extends basem.ClientApiBase { '$expandIdentity': expandIdentity, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "core", "d30a3dd1-f8ba-442a-b86a-bd0c0c383e59", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "core", "d30a3dd1-f8ba-442a-b86a-bd0c0c383e59", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6378,7 +7120,7 @@ class CoreApi extends basem.ClientApiBase { teamId: teamId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "core", "d30a3dd1-f8ba-442a-b86a-bd0c0c383e59", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "core", "d30a3dd1-f8ba-442a-b86a-bd0c0c383e59", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6393,8 +7135,8 @@ class CoreApi extends basem.ClientApiBase { }); } } -CoreApi.RESOURCE_AREA_ID = "79134c72-4a58-4b42-976c-04e7115f32bf"; exports.CoreApi = CoreApi; +CoreApi.RESOURCE_AREA_ID = "79134c72-4a58-4b42-976c-04e7115f32bf"; /***/ }), @@ -6414,19 +7156,21 @@ exports.CoreApi = CoreApi; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DashboardApi = void 0; const basem = __nccwpck_require__(273); const DashboardInterfaces = __nccwpck_require__(6890); class DashboardApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Dashboard-api', options); + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Dashboard-api', options); } /** * Create the supplied dashboard. @@ -6448,7 +7192,7 @@ class DashboardApi extends basem.ClientApiBase { team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6483,7 +7227,7 @@ class DashboardApi extends basem.ClientApiBase { dashboardId: dashboardId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6518,7 +7262,7 @@ class DashboardApi extends basem.ClientApiBase { dashboardId: dashboardId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6551,7 +7295,7 @@ class DashboardApi extends basem.ClientApiBase { team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6587,7 +7331,7 @@ class DashboardApi extends basem.ClientApiBase { dashboardId: dashboardId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6621,7 +7365,7 @@ class DashboardApi extends basem.ClientApiBase { team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Dashboard", "454b3e51-2e6e-48d4-ad81-978154089351", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6657,7 +7401,7 @@ class DashboardApi extends basem.ClientApiBase { dashboardId: dashboardId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Dashboard", "bdcff53a-8355-4172-a00a-40497ea23afc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Dashboard", "bdcff53a-8355-4172-a00a-40497ea23afc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6694,7 +7438,7 @@ class DashboardApi extends basem.ClientApiBase { widgetId: widgetId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Dashboard", "bdcff53a-8355-4172-a00a-40497ea23afc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Dashboard", "bdcff53a-8355-4172-a00a-40497ea23afc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6731,7 +7475,7 @@ class DashboardApi extends basem.ClientApiBase { widgetId: widgetId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Dashboard", "bdcff53a-8355-4172-a00a-40497ea23afc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Dashboard", "bdcff53a-8355-4172-a00a-40497ea23afc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6769,7 +7513,7 @@ class DashboardApi extends basem.ClientApiBase { widgetId: widgetId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Dashboard", "bdcff53a-8355-4172-a00a-40497ea23afc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Dashboard", "bdcff53a-8355-4172-a00a-40497ea23afc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6807,7 +7551,7 @@ class DashboardApi extends basem.ClientApiBase { widgetId: widgetId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Dashboard", "bdcff53a-8355-4172-a00a-40497ea23afc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Dashboard", "bdcff53a-8355-4172-a00a-40497ea23afc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6835,7 +7579,7 @@ class DashboardApi extends basem.ClientApiBase { contributionId: contributionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Dashboard", "6b3628d3-e96f-4fc7-b176-50240b03b515", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Dashboard", "6b3628d3-e96f-4fc7-b176-50240b03b515", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6868,7 +7612,7 @@ class DashboardApi extends basem.ClientApiBase { '$scope': scope, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Dashboard", "6b3628d3-e96f-4fc7-b176-50240b03b515", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Dashboard", "6b3628d3-e96f-4fc7-b176-50240b03b515", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6883,8 +7627,8 @@ class DashboardApi extends basem.ClientApiBase { }); } } -DashboardApi.RESOURCE_AREA_ID = "31c84e0a-3ece-48fd-a29d-100849af99ba"; exports.DashboardApi = DashboardApi; +DashboardApi.RESOURCE_AREA_ID = "31c84e0a-3ece-48fd-a29d-100849af99ba"; /***/ }), @@ -6904,28 +7648,32 @@ exports.DashboardApi = DashboardApi; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExtensionManagementApi = void 0; const basem = __nccwpck_require__(273); const ExtensionManagementInterfaces = __nccwpck_require__(7357); const GalleryInterfaces = __nccwpck_require__(8905); class ExtensionManagementApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-ExtensionManagement-api', options); + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-ExtensionManagement-api', options); } /** - * @param {string} itemId - * @param {boolean} testCommerce - * @param {boolean} isFreeOrTrialInstall - * @param {boolean} isAccountOwner - * @param {boolean} isLinked - * @param {boolean} isConnectedServer + * This API is called by acquisition/install page to get possible user actions like Buy/Request + * + * @param {string} itemId - Fully qualified name of extension (.) + * @param {boolean} testCommerce - Parameter to test paid preview extension without making azure plans public + * @param {boolean} isFreeOrTrialInstall - Parameter represents install or trial workflow (required for legacy install flows) + * @param {boolean} isAccountOwner - Parameter represents whether user is owner or PCA of an account + * @param {boolean} isLinked - Parameter represents whether account is linked with a subscription + * @param {boolean} isConnectedServer - Parameter represents whether Buy operation should be evaluated * @param {boolean} isBuyOperationValid */ getAcquisitionOptions(itemId, testCommerce, isFreeOrTrialInstall, isAccountOwner, isLinked, isConnectedServer, isBuyOperationValid) { @@ -6945,7 +7693,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { isBuyOperationValid: isBuyOperationValid, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "288dff58-d13b-468e-9671-0fb754e9398c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "288dff58-d13b-468e-9671-0fb754e9398c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6967,7 +7715,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "da616457-eed3-4672-92d7-18d21f5c1658", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "da616457-eed3-4672-92d7-18d21f5c1658", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -6993,7 +7741,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { extensionName: extensionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "23a312e0-562d-42fb-a505-5a046b5635db", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "23a312e0-562d-42fb-a505-5a046b5635db", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7021,7 +7769,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { registrationId: registrationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "f21cfc80-d2d2-4248-98bb-7820c74c4606", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "f21cfc80-d2d2-4248-98bb-7820c74c4606", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7054,7 +7802,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { collectionName: collectionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7088,7 +7836,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { documentId: documentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7122,7 +7870,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { documentId: documentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7154,7 +7902,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { collectionName: collectionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7187,7 +7935,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { collectionName: collectionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7220,7 +7968,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { collectionName: collectionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "bbe06c18-1c8b-4fcd-b9c6-1535aaab8749", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7249,7 +7997,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { extensionName: extensionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "56c331f1-ce53-4318-adfd-4db5c52a7a2e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "56c331f1-ce53-4318-adfd-4db5c52a7a2e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7282,7 +8030,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { forceRefresh: forceRefresh, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "92755d3d-9a8a-42b3-8a4d-87359fe5aa93", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "ExtensionManagement", "92755d3d-9a8a-42b3-8a4d-87359fe5aa93", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7304,7 +8052,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "046c980f-1345-4ce2-bf85-b46d10ff4cfd", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "ExtensionManagement", "046c980f-1345-4ce2-bf85-b46d10ff4cfd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7323,7 +8071,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { * * @param {boolean} includeDisabledExtensions - If true (the default), include disabled extensions in the results. * @param {boolean} includeErrors - If true, include installed extensions with errors. - * @param {string[]} assetTypes + * @param {string[]} assetTypes - Determines which files are returned in the files array. Provide the wildcard '*' to return all files, or a colon separated list to retrieve files with specific asset types. * @param {boolean} includeInstallationIssues */ getInstalledExtensions(includeDisabledExtensions, includeErrors, assetTypes, includeInstallationIssues) { @@ -7337,7 +8085,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { includeInstallationIssues: includeInstallationIssues, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "275424d0-c844-4fe2-bda6-04933a1357d8", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "ExtensionManagement", "275424d0-c844-4fe2-bda6-04933a1357d8", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7361,7 +8109,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "275424d0-c844-4fe2-bda6-04933a1357d8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "ExtensionManagement", "275424d0-c844-4fe2-bda6-04933a1357d8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7380,7 +8128,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { * * @param {string} publisherName - Name of the publisher. Example: "fabrikam". * @param {string} extensionName - Name of the extension. Example: "ops-tools". - * @param {string[]} assetTypes + * @param {string[]} assetTypes - Determines which files are returned in the files array. Provide the wildcard '*' to return all files, or a colon separated list to retrieve files with specific asset types. */ getInstalledExtensionByName(publisherName, extensionName, assetTypes) { return __awaiter(this, void 0, void 0, function* () { @@ -7393,7 +8141,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { assetTypes: assetTypes && assetTypes.join(":"), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "fb0da285-f23e-4b56-8b53-3ef5f9f6de66", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "ExtensionManagement", "fb0da285-f23e-4b56-8b53-3ef5f9f6de66", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7423,7 +8171,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { version: version }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "fb0da285-f23e-4b56-8b53-3ef5f9f6de66", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "ExtensionManagement", "fb0da285-f23e-4b56-8b53-3ef5f9f6de66", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7457,7 +8205,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { reasonCode: reasonCode, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "fb0da285-f23e-4b56-8b53-3ef5f9f6de66", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "ExtensionManagement", "fb0da285-f23e-4b56-8b53-3ef5f9f6de66", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7481,7 +8229,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { userId: userId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "e5cc8c09-407b-4867-8319-2ae3338cbf6f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "e5cc8c09-407b-4867-8319-2ae3338cbf6f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7517,7 +8265,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { state: state, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "aa93e1f3-511c-4364-8b9c-eb98818f2e0b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "aa93e1f3-511c-4364-8b9c-eb98818f2e0b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7538,7 +8286,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "216b978f-b164-424e-ada2-b77561e842b7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "216b978f-b164-424e-ada2-b77561e842b7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7572,7 +8320,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { state: state, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "ba93e1f3-511c-4364-8b9c-eb98818f2e0b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "ba93e1f3-511c-4364-8b9c-eb98818f2e0b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7598,7 +8346,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { extensionName: extensionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "f5afca1e-a728-4294-aa2d-4af0173431b5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "f5afca1e-a728-4294-aa2d-4af0173431b5", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7625,7 +8373,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { extensionName: extensionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "f5afca1e-a728-4294-aa2d-4af0173431b5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "f5afca1e-a728-4294-aa2d-4af0173431b5", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7646,7 +8394,7 @@ class ExtensionManagementApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "ExtensionManagement", "3a2e24ed-1d6f-4cb2-9f3b-45a96bbfaf50", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "ExtensionManagement", "3a2e24ed-1d6f-4cb2-9f3b-45a96bbfaf50", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7661,8 +8409,8 @@ class ExtensionManagementApi extends basem.ClientApiBase { }); } } -ExtensionManagementApi.RESOURCE_AREA_ID = "6c2b0933-3600-42ae-bf8b-93d4f7e83594"; exports.ExtensionManagementApi = ExtensionManagementApi; +ExtensionManagementApi.RESOURCE_AREA_ID = "6c2b0933-3600-42ae-bf8b-93d4f7e83594"; /***/ }), @@ -7682,19 +8430,21 @@ exports.ExtensionManagementApi = ExtensionManagementApi; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FeatureManagementApi = void 0; const basem = __nccwpck_require__(273); const FeatureManagementInterfaces = __nccwpck_require__(7278); class FeatureManagementApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-FeatureManagement-api', options); + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-FeatureManagement-api', options); } /** * Get a specific feature by its id @@ -7708,7 +8458,7 @@ class FeatureManagementApi extends basem.ClientApiBase { featureId: featureId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "FeatureManagement", "c4209f25-7a27-41dd-9f04-06080c7b6afd", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "FeatureManagement", "c4209f25-7a27-41dd-9f04-06080c7b6afd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7735,7 +8485,7 @@ class FeatureManagementApi extends basem.ClientApiBase { targetContributionId: targetContributionId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "FeatureManagement", "c4209f25-7a27-41dd-9f04-06080c7b6afd", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "FeatureManagement", "c4209f25-7a27-41dd-9f04-06080c7b6afd", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7763,7 +8513,7 @@ class FeatureManagementApi extends basem.ClientApiBase { userScope: userScope }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "FeatureManagement", "98911314-3f9b-4eaf-80e8-83900d8e85d9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "FeatureManagement", "98911314-3f9b-4eaf-80e8-83900d8e85d9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7798,7 +8548,7 @@ class FeatureManagementApi extends basem.ClientApiBase { reasonCode: reasonCode, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "FeatureManagement", "98911314-3f9b-4eaf-80e8-83900d8e85d9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "FeatureManagement", "98911314-3f9b-4eaf-80e8-83900d8e85d9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7830,7 +8580,7 @@ class FeatureManagementApi extends basem.ClientApiBase { scopeValue: scopeValue }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "FeatureManagement", "dd291e43-aa9f-4cee-8465-a93c78e414a4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "FeatureManagement", "dd291e43-aa9f-4cee-8465-a93c78e414a4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7869,7 +8619,7 @@ class FeatureManagementApi extends basem.ClientApiBase { reasonCode: reasonCode, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "FeatureManagement", "dd291e43-aa9f-4cee-8465-a93c78e414a4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "FeatureManagement", "dd291e43-aa9f-4cee-8465-a93c78e414a4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7893,7 +8643,7 @@ class FeatureManagementApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "FeatureManagement", "2b4486ad-122b-400c-ae65-17b6672c1f9d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "FeatureManagement", "2b4486ad-122b-400c-ae65-17b6672c1f9d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7920,7 +8670,7 @@ class FeatureManagementApi extends basem.ClientApiBase { userScope: userScope }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "FeatureManagement", "3f810f28-03e2-4239-b0bc-788add3005e5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "FeatureManagement", "3f810f28-03e2-4239-b0bc-788add3005e5", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7951,7 +8701,7 @@ class FeatureManagementApi extends basem.ClientApiBase { scopeValue: scopeValue }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "FeatureManagement", "f29e997b-c2da-4d15-8380-765788a1a74c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "FeatureManagement", "f29e997b-c2da-4d15-8380-765788a1a74c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -7986,14 +8736,16 @@ exports.FeatureManagementApi = FeatureManagementApi; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FileContainerApi = void 0; // Licensed under the MIT license. See LICENSE file in the project root for full license information. const stream = __nccwpck_require__(2781); const zlib = __nccwpck_require__(9796); @@ -8001,8 +8753,8 @@ const httpm = __nccwpck_require__(5538); const FileContainerApiBase = __nccwpck_require__(5145); const FileContainerInterfaces = __nccwpck_require__(6110); class FileContainerApi extends FileContainerApiBase.FileContainerApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, options); + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, options, userAgent); } /** * @param {number} containerId @@ -8229,22 +8981,24 @@ class BufferStream extends stream.Readable { * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FileContainerApiBase = void 0; const basem = __nccwpck_require__(273); const FileContainerInterfaces = __nccwpck_require__(6110); class FileContainerApiBase extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-FileContainer-api', options); + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-FileContainer-api', options); } /** - * Creates the specified items in in the referenced container. + * Creates the specified items in the referenced container. * * @param {VSSInterfaces.VssJsonCollectionWrapperV} items * @param {number} containerId @@ -8260,7 +9014,7 @@ class FileContainerApiBase extends basem.ClientApiBase { scope: scope, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Container", "e4f5c81e-e250-447b-9fef-bd48471bea5e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Container", "e4f5c81e-e250-447b-9fef-bd48471bea5e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8295,7 +9049,7 @@ class FileContainerApiBase extends basem.ClientApiBase { scope: scope, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Container", "e4f5c81e-e250-447b-9fef-bd48471bea5e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Container", "e4f5c81e-e250-447b-9fef-bd48471bea5e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8324,7 +9078,7 @@ class FileContainerApiBase extends basem.ClientApiBase { artifactUris: artifactUris, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Container", "e4f5c81e-e250-447b-9fef-bd48471bea5e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Container", "e4f5c81e-e250-447b-9fef-bd48471bea5e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8339,19 +9093,22 @@ class FileContainerApiBase extends basem.ClientApiBase { }); } /** - * @param {number} containerId - * @param {string} scope - * @param {string} itemPath - * @param {boolean} metadata - * @param {string} format - * @param {string} downloadFileName + * Gets the specified file container object in a format dependent upon the given parameters or HTTP Accept request header + * + * @param {number} containerId - The requested container Id + * @param {string} scope - A guid representing the scope of the container. This is often the project id. + * @param {string} itemPath - The path to the item of interest + * @param {boolean} metadata - If true, this overrides any specified format parameter or HTTP Accept request header to provide non-recursive information for the given itemPath + * @param {string} format - If specified, this overrides the HTTP Accept request header to return either 'json' or 'zip'. If $format is specified, then api-version should also be specified as a query parameter. + * @param {string} downloadFileName - If specified and returning other than JSON format, then this download name will be used (else defaults to itemPath) * @param {boolean} includeDownloadTickets - * @param {boolean} isShallow - * @param {boolean} ignoreRequestedMediaType + * @param {boolean} isShallow - If true, returns only immediate children(files & folders) for the given itemPath. False will return all items recursively within itemPath. + * @param {boolean} ignoreRequestedMediaType - Set to true to ignore the HTTP Accept request header. Default is false. * @param {boolean} includeBlobMetadata - * @param {boolean} saveAbsolutePath + * @param {boolean} saveAbsolutePath - Set to false to not save the absolute path to the specified directory of the artifact in the returned archive. Works only for artifact directories. Default is true. + * @param {boolean} preferRedirect - Set to true to get the redirect response which leads to the stream with content. Default is false. */ - getItems(containerId, scope, itemPath, metadata, format, downloadFileName, includeDownloadTickets, isShallow, ignoreRequestedMediaType, includeBlobMetadata, saveAbsolutePath) { + getItems(containerId, scope, itemPath, metadata, format, downloadFileName, includeDownloadTickets, isShallow, ignoreRequestedMediaType, includeBlobMetadata, saveAbsolutePath, preferRedirect) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { @@ -8368,9 +9125,10 @@ class FileContainerApiBase extends basem.ClientApiBase { ignoreRequestedMediaType: ignoreRequestedMediaType, includeBlobMetadata: includeBlobMetadata, saveAbsolutePath: saveAbsolutePath, + preferRedirect: preferRedirect, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Container", "e4f5c81e-e250-447b-9fef-bd48471bea5e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Container", "e4f5c81e-e250-447b-9fef-bd48471bea5e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8405,19 +9163,21 @@ exports.FileContainerApiBase = FileContainerApiBase; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.GalleryApi = void 0; const compatBase = __nccwpck_require__(946); const GalleryInterfaces = __nccwpck_require__(8905); class GalleryApi extends compatBase.GalleryCompatHttpClientBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Gallery-api', options); + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Gallery-api', options); } /** * @param {string} extensionId @@ -8431,7 +9191,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { accountName: accountName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "1f19631b-a0b4-4a03-89c2-d79785d24360", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "1f19631b-a0b4-4a03-89c2-d79785d24360", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8457,7 +9217,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { accountName: accountName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "1f19631b-a0b4-4a03-89c2-d79785d24360", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "1f19631b-a0b4-4a03-89c2-d79785d24360", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8485,7 +9245,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { accountName: accountName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "a1e66d8f-f5de-4d16-8309-91a4e015ee46", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "a1e66d8f-f5de-4d16-8309-91a4e015ee46", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8513,7 +9273,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { accountName: accountName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "a1e66d8f-f5de-4d16-8309-91a4e015ee46", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "a1e66d8f-f5de-4d16-8309-91a4e015ee46", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8548,7 +9308,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { isFreeOrTrialInstall: isFreeOrTrialInstall, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "9d0a0105-075e-4760-aa15-8bcf54d1bd7d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "9d0a0105-075e-4760-aa15-8bcf54d1bd7d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8570,7 +9330,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "3adb1f2d-e328-446e-be73-9f6d98071c45", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "3adb1f2d-e328-446e-be73-9f6d98071c45", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8609,7 +9369,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["X-Market-AccountToken"] = "accountTokenHeader"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "7529171f-a002-4180-93ba-685f358a0482", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "7529171f-a002-4180-93ba-685f358a0482", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -8644,7 +9404,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["X-Market-AccountToken"] = "accountTokenHeader"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "5d545f3d-ef47-488b-8be3-f5ee1517856c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "5d545f3d-ef47-488b-8be3-f5ee1517856c", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -8679,7 +9439,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["X-Market-AccountToken"] = "accountTokenHeader"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "506aff36-2622-4f70-8063-77cce6366d20", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "506aff36-2622-4f70-8063-77cce6366d20", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -8708,7 +9468,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { azurePublisherId: azurePublisherId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "efd202a6-9d87-4ebc-9229-d2b8ae2fdb6d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "efd202a6-9d87-4ebc-9229-d2b8ae2fdb6d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8732,7 +9492,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { publisherName: publisherName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "efd202a6-9d87-4ebc-9229-d2b8ae2fdb6d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "efd202a6-9d87-4ebc-9229-d2b8ae2fdb6d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8757,7 +9517,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { languages: languages, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "e0a5a71e-3ac3-43a0-ae7d-0bb5c3046a2a", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "e0a5a71e-3ac3-43a0-ae7d-0bb5c3046a2a", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8787,7 +9547,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { product: product, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "75d3c04d-84d2-4973-acd2-22627587dabc", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "75d3c04d-84d2-4973-acd2-22627587dabc", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8809,8 +9569,9 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { * @param {string} productVersion * @param {string} skus * @param {string} subSkus + * @param {string} productArchitecture */ - getCategoryTree(product, categoryId, lcid, source, productVersion, skus, subSkus) { + getCategoryTree(product, categoryId, lcid, source, productVersion, skus, subSkus, productArchitecture) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { @@ -8823,9 +9584,10 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { productVersion: productVersion, skus: skus, subSkus: subSkus, + productArchitecture: productArchitecture, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "1102bb42-82b0-4955-8d8a-435d6b4cedd3", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "1102bb42-82b0-4955-8d8a-435d6b4cedd3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8861,7 +9623,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { subSkus: subSkus, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "31fba831-35b2-46f6-a641-d05de5a877d8", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "31fba831-35b2-46f6-a641-d05de5a877d8", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8889,31 +9651,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { version: version }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "e905ad6a-3f1f-4d08-9f6d-7d357ff8b7d0", routeValues); - let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); - } - catch (err) { - reject(err); - } - })); - }); - } - /** - * @param {string} publisherName - * @param {string} extensionName - */ - getContentVerificationLog(publisherName, extensionName) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - publisherName: publisherName, - extensionName: extensionName - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "c0f1c7c4-3557-4ffb-b774-1e48c4865e99", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "e905ad6a-3f1f-4d08-9f6d-7d357ff8b7d0", routeValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -8933,7 +9671,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "8eded385-026a-4c15-b810-b8eb402771f1", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "8eded385-026a-4c15-b810-b8eb402771f1", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8959,7 +9697,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { extensionName: extensionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "02b33873-4e61-496e-83a2-59d1df46b7d8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "02b33873-4e61-496e-83a2-59d1df46b7d8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -8988,7 +9726,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { draftId: draftId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "02b33873-4e61-496e-83a2-59d1df46b7d8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "02b33873-4e61-496e-83a2-59d1df46b7d8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9021,7 +9759,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders["Content-Type"] = "application/octet-stream"; customHeaders["X-Market-UploadFileName"] = "fileName"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "02b33873-4e61-496e-83a2-59d1df46b7d8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "02b33873-4e61-496e-83a2-59d1df46b7d8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9055,7 +9793,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "f1db9c47-6619-4998-a7e5-d7f9f41a4617", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "f1db9c47-6619-4998-a7e5-d7f9f41a4617", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9087,7 +9825,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders["X-Market-UploadFileProduct"] = "product"; customHeaders["X-Market-UploadFileName"] = "fileName"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "b3ab127d-ebb9-4d22-b611-4e09593c8d79", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "b3ab127d-ebb9-4d22-b611-4e09593c8d79", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9115,7 +9853,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { draftId: draftId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "b3ab127d-ebb9-4d22-b611-4e09593c8d79", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "b3ab127d-ebb9-4d22-b611-4e09593c8d79", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9146,7 +9884,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders["Content-Type"] = "application/octet-stream"; customHeaders["X-Market-UploadFileName"] = "fileName"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "b3ab127d-ebb9-4d22-b611-4e09593c8d79", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "b3ab127d-ebb9-4d22-b611-4e09593c8d79", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9178,7 +9916,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "88c0b1c8-b4f1-498a-9b2a-8446ef9f32e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "88c0b1c8-b4f1-498a-9b2a-8446ef9f32e7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9214,7 +9952,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { extensionName: extensionName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "88c0b1c8-b4f1-498a-9b2a-8446ef9f32e7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "88c0b1c8-b4f1-498a-9b2a-8446ef9f32e7", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -9240,7 +9978,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { assetType: assetType }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "88c0b1c8-b4f1-498a-9b2a-8446ef9f32e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "88c0b1c8-b4f1-498a-9b2a-8446ef9f32e7", routeValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -9276,7 +10014,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { includeProperty: includeProperty, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "3d13c499-2168-4d06-bef4-14aba185dcd5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "3d13c499-2168-4d06-bef4-14aba185dcd5", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9300,7 +10038,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "0bf2bd3a-70e0-4d5d-8bf7-bd4a9c2ab6e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "0bf2bd3a-70e0-4d5d-8bf7-bd4a9c2ab6e7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9329,7 +10067,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["X-Market-AccountToken"] = "accountTokenHeader"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "eb9d5ee1-6d43-456b-b80e-8a96fbc014b6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "eb9d5ee1-6d43-456b-b80e-8a96fbc014b6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9360,7 +10098,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "gallery", "a41192c8-9525-4b58-bc86-179fa549d80d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "gallery", "a41192c8-9525-4b58-bc86-179fa549d80d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9389,7 +10127,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { version: version, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "gallery", "a41192c8-9525-4b58-bc86-179fa549d80d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "gallery", "a41192c8-9525-4b58-bc86-179fa549d80d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9419,7 +10157,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { flags: flags, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "gallery", "a41192c8-9525-4b58-bc86-179fa549d80d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "gallery", "a41192c8-9525-4b58-bc86-179fa549d80d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9447,7 +10185,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { reCaptchaToken: reCaptchaToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "gallery", "a41192c8-9525-4b58-bc86-179fa549d80d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "gallery", "a41192c8-9525-4b58-bc86-179fa549d80d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9480,7 +10218,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0966", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0966", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9511,7 +10249,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { version: version, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0966", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0966", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9548,7 +10286,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["X-Market-AccountToken"] = "accountTokenHeader"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0966", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0966", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9588,7 +10326,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0966", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0966", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9622,7 +10360,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { flags: flags, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0966", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0966", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9652,7 +10390,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { hostName: hostName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "328a3af8-d124-46e9-9483-01690cd415b9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "328a3af8-d124-46e9-9483-01690cd415b9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9682,7 +10420,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { hostName: hostName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "328a3af8-d124-46e9-9483-01690cd415b9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "328a3af8-d124-46e9-9483-01690cd415b9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9697,14 +10435,16 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { }); } /** - * @param {GalleryInterfaces.AzureRestApiRequestModel} azureRestApiRequestModel + * Rest end point to validate if an Azure publisher owns an extension for 3rd party commerce scenario. Azure only supports POST operations and the above signature is not typical of the REST operations. http://sharepoint/sites/AzureUX/_layouts/15/WopiFrame2.aspx?sourcedoc={A793D31E-6DC6-4174-8FA3-DE3F82B51642}&file=Data%20Market%20Partner%20integration%20with%20Marketplace%20service.docx&action=default + * + * @param {GalleryInterfaces.AzureRestApiRequestModel} azureRestApiRequestModel - All the parameters are sent in the request body */ extensionValidator(azureRestApiRequestModel) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "05e8a5e1-8c59-4c2c-8856-0ff087d1a844", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "05e8a5e1-8c59-4c2c-8856-0ff087d1a844", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9728,7 +10468,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "eab39817-413c-4602-a49f-07ad00844980", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "eab39817-413c-4602-a49f-07ad00844980", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9767,7 +10507,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["X-Market-AccountToken"] = "accountTokenHeader"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "7cb576f8-1cae-4c4b-b7b1-e4af5759e965", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "7cb576f8-1cae-4c4b-b7b1-e4af5759e965", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -9806,7 +10546,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders = customHeaders || {}; customHeaders["X-Market-AccountToken"] = "accountTokenHeader"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "364415a1-0077-4a41-a7a0-06edd4497492", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "364415a1-0077-4a41-a7a0-06edd4497492", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -9834,7 +10574,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { assetType: assetType, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "21143299-34f9-4c62-8ca8-53da691192f9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "21143299-34f9-4c62-8ca8-53da691192f9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9864,7 +10604,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { assetType: assetType, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "21143299-34f9-4c62-8ca8-53da691192f9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "21143299-34f9-4c62-8ca8-53da691192f9", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -9897,7 +10637,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { customHeaders["Content-Type"] = "application/octet-stream"; customHeaders["X-Market-UploadFileName"] = "fileName"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "21143299-34f9-4c62-8ca8-53da691192f9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "21143299-34f9-4c62-8ca8-53da691192f9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -9912,6 +10652,54 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { })); }); } + /** + * @param {string} publisherName + */ + fetchDomainToken(publisherName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + publisherName: publisherName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "67a609ef-fa74-4b52-8664-78d76f7b3634", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {string} publisherName + */ + verifyDomainToken(publisherName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + publisherName: publisherName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "67a609ef-fa74-4b52-8664-78d76f7b3634", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, null, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** * @param {GalleryInterfaces.PublisherQuery} publisherQuery */ @@ -9920,7 +10708,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "2ad6ee0a-b53f-4034-9d1d-d009fda1212e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "2ad6ee0a-b53f-4034-9d1d-d009fda1212e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9942,7 +10730,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "4ddec66a-e4f6-4f5d-999e-9e77710d7ff4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "4ddec66a-e4f6-4f5d-999e-9e77710d7ff4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9966,7 +10754,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { publisherName: publisherName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "4ddec66a-e4f6-4f5d-999e-9e77710d7ff4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "4ddec66a-e4f6-4f5d-999e-9e77710d7ff4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -9994,7 +10782,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { flags: flags, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "4ddec66a-e4f6-4f5d-999e-9e77710d7ff4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "4ddec66a-e4f6-4f5d-999e-9e77710d7ff4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10019,7 +10807,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { publisherName: publisherName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "4ddec66a-e4f6-4f5d-999e-9e77710d7ff4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "4ddec66a-e4f6-4f5d-999e-9e77710d7ff4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10050,7 +10838,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { limitToCallerIdentityDomain: limitToCallerIdentityDomain, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "4ddec66a-e4f6-4f5d-999e-9e77710d7ff4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "4ddec66a-e4f6-4f5d-999e-9e77710d7ff4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10064,6 +10852,68 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { })); }); } + /** + * @param {NodeJS.ReadableStream} contentStream - Content to upload + * @param {string} publisherName + * @param {string} extensionName + * @param {string} extensionType + * @param {string} reCaptchaToken + * @param {boolean} bypassScopeCheck + */ + publishExtensionWithPublisherSignature(customHeaders, contentStream, publisherName, extensionName, extensionType, reCaptchaToken, bypassScopeCheck) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + publisherName: publisherName, + extensionName: extensionName + }; + let queryValues = { + extensionType: extensionType, + reCaptchaToken: reCaptchaToken, + bypassScopeCheck: bypassScopeCheck, + }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "multipart/related"; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "e11ea35a-16fe-4b80-ab11-c4cab88a0969", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; + let res; + res = yield this.rest.uploadStream("PUT", url, contentStream, options); + let ret = this.formatResponse(res.result, GalleryInterfaces.TypeInfo.PublishedExtension, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {string} publisherName + */ + getPublisherWithoutToken(publisherName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + publisherName: publisherName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "215a2ed8-458a-4850-ad5a-45f1dabc3461", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, GalleryInterfaces.TypeInfo.Publisher, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** * Returns a list of questions with their responses associated with an extension. * @@ -10086,7 +10936,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { afterDate: afterDate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "c010d03d-812c-4ade-ae07-c1862475eda5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "c010d03d-812c-4ade-ae07-c1862475eda5", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10117,7 +10967,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { questionId: questionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "784910cd-254a-494d-898b-0728549b2f10", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "784910cd-254a-494d-898b-0728549b2f10", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10146,7 +10996,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { extensionName: extensionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "6d1d9741-eca8-4701-a3a5-235afc82dfa4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "6d1d9741-eca8-4701-a3a5-235afc82dfa4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10176,7 +11026,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { questionId: questionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "6d1d9741-eca8-4701-a3a5-235afc82dfa4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "6d1d9741-eca8-4701-a3a5-235afc82dfa4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10207,7 +11057,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { questionId: questionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "6d1d9741-eca8-4701-a3a5-235afc82dfa4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "6d1d9741-eca8-4701-a3a5-235afc82dfa4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10238,7 +11088,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { questionId: questionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "7f8ae5e0-46b0-438f-b2e8-13e8513517bd", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "7f8ae5e0-46b0-438f-b2e8-13e8513517bd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10270,7 +11120,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { responseId: responseId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "7f8ae5e0-46b0-438f-b2e8-13e8513517bd", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "7f8ae5e0-46b0-438f-b2e8-13e8513517bd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10303,7 +11153,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { responseId: responseId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "7f8ae5e0-46b0-438f-b2e8-13e8513517bd", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "7f8ae5e0-46b0-438f-b2e8-13e8513517bd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10339,7 +11189,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { afterDate: afterDate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "79e0c74f-157f-437e-845f-74fbb4121d4c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "79e0c74f-157f-437e-845f-74fbb4121d4c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10377,7 +11227,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { afterDate: afterDate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "5b3f819f-f247-42ad-8c00-dd9ab9ab246d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "5b3f819f-f247-42ad-8c00-dd9ab9ab246d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10411,7 +11261,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { afterDate: afterDate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "b7b44e21-209e-48f0-ae78-04727fc37d77", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "b7b44e21-209e-48f0-ae78-04727fc37d77", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10440,7 +11290,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { extName: extName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "e6e85b9d-aa70-40e6-aa28-d0fbf40b91a3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "e6e85b9d-aa70-40e6-aa28-d0fbf40b91a3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10470,7 +11320,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { reviewId: reviewId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "e6e85b9d-aa70-40e6-aa28-d0fbf40b91a3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "e6e85b9d-aa70-40e6-aa28-d0fbf40b91a3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10501,7 +11351,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { reviewId: reviewId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "e6e85b9d-aa70-40e6-aa28-d0fbf40b91a3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "e6e85b9d-aa70-40e6-aa28-d0fbf40b91a3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10523,7 +11373,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "476531a3-7024-4516-a76a-ed64d3008ad6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "476531a3-7024-4516-a76a-ed64d3008ad6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10551,7 +11401,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { key: key }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "9b75ece3-7960-401c-848b-148ac01ca350", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "9b75ece3-7960-401c-848b-148ac01ca350", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10578,7 +11428,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { userScope: userScope }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "9b75ece3-7960-401c-848b-148ac01ca350", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "9b75ece3-7960-401c-848b-148ac01ca350", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10606,7 +11456,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { expireCurrentSeconds: expireCurrentSeconds, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "92ed5cf4-c38b-465a-9059-2f2fb7c624b5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "92ed5cf4-c38b-465a-9059-2f2fb7c624b5", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10630,7 +11480,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { keyType: keyType }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "92ed5cf4-c38b-465a-9059-2f2fb7c624b5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "92ed5cf4-c38b-465a-9059-2f2fb7c624b5", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10657,7 +11507,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { extensionName: extensionName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "a0ea3204-11e9-422d-a9ca-45851cc41400", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "a0ea3204-11e9-422d-a9ca-45851cc41400", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10691,7 +11541,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { afterDate: afterDate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "ae06047e-51c5-4fb4-ab65-7be488544416", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "ae06047e-51c5-4fb4-ab65-7be488544416", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10721,7 +11571,7 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { version: version }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "4fa7adb6-ca65-4075-a232-5f28323288ea", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "4fa7adb6-ca65-4075-a232-5f28323288ea", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10742,8 +11592,9 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { * @param {string} extensionName - Name of the extension * @param {string} version - Version of the extension * @param {string} statType - Type of stat to increment + * @param {string} targetPlatform */ - incrementExtensionDailyStat(publisherName, extensionName, version, statType) { + incrementExtensionDailyStat(publisherName, extensionName, version, statType, targetPlatform) { return __awaiter(this, void 0, void 0, function* () { if (statType == null) { throw new TypeError('statType can not be null or undefined'); @@ -10756,9 +11607,10 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { }; let queryValues = { statType: statType, + targetPlatform: targetPlatform, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "4fa7adb6-ca65-4075-a232-5f28323288ea", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "4fa7adb6-ca65-4075-a232-5f28323288ea", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -10776,8 +11628,9 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { * @param {string} publisherName * @param {string} extensionName * @param {string} version + * @param {string} targetPlatform */ - getVerificationLog(publisherName, extensionName, version) { + getVerificationLog(publisherName, extensionName, version, targetPlatform) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { @@ -10785,8 +11638,11 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { extensionName: extensionName, version: version }; + let queryValues = { + targetPlatform: targetPlatform, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "gallery", "c5523abe-b843-437f-875b-5833064efe4d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "c5523abe-b843-437f-875b-5833064efe4d", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -10798,9 +11654,65 @@ class GalleryApi extends compatBase.GalleryCompatHttpClientBase { })); }); } + /** + * Endpoint to get the latest version(s) of a VS Code extension. + * + * @param {string} publisherName - The name of the publisher of the requested VS Code extension. + * @param {string} extensionName - The extension name. + */ + getVSCodeExtensionLatestVersion(publisherName, extensionName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + publisherName: publisherName, + extensionName: extensionName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "86037ad5-f601-40fb-b363-6ff262b61521", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, GalleryInterfaces.TypeInfo.PublishedExtension, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {string} itemName + * @param {string} version + * @param {GalleryInterfaces.VSCodeWebExtensionStatisicsType} statType + */ + updateVSCodeWebExtensionStatistics(itemName, version, statType) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + itemName: itemName, + version: version, + statType: statType + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "gallery", "205c91a8-7841-4fd3-ae4f-5a745d5a8df5", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } } -GalleryApi.RESOURCE_AREA_ID = "69d21c00-f135-441b-b5ce-3626378e0819"; exports.GalleryApi = GalleryApi; +GalleryApi.RESOURCE_AREA_ID = "69d21c00-f135-441b-b5ce-3626378e0819"; /***/ }), @@ -10820,14 +11732,16 @@ exports.GalleryApi = GalleryApi; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.GalleryCompatHttpClientBase = void 0; const basem = __nccwpck_require__(273); const GalleryInterfaces = __nccwpck_require__(8905); class GalleryCompatHttpClientBase extends basem.ClientApiBase { @@ -10946,19 +11860,337 @@ exports.GalleryCompatHttpClientBase = GalleryCompatHttpClientBase; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.GitApi = void 0; const basem = __nccwpck_require__(273); const GitInterfaces = __nccwpck_require__(9803); class GitApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Git-api', options); + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Git-api', options); + } + /** + * DELETE Deletes Enablement status and BillableCommitters data from DB. Deleting the enablement data will effectively disable it for the repositories affected. + * + * @param {boolean} allProjects + * @param {boolean} includeBillableCommitters + * @param {string[]} projectIds + */ + deleteEnablementStatus(allProjects, includeBillableCommitters, projectIds) { + return __awaiter(this, void 0, void 0, function* () { + if (allProjects == null) { + throw new TypeError('allProjects can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + '$allProjects': allProjects, + '$includeBillableCommitters': includeBillableCommitters, + projectIds: projectIds, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * GET Enablement status for project's repositories. + * + * @param {string[]} projectIds - Null defaults to all projects in the host, list of project's repos status to return + * @param {Date} billingDate - UTC expected, Null defaults to UtcNow(), can be provided for a point in time status + * @param {number} skip - Skip X rows of resultset to simulate paging. + * @param {number} take - Return Y rows of resultset to simulate paging. + */ + getEnablementStatus(projectIds, billingDate, skip, take) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + projectIds: projectIds, + '$billingDate': billingDate, + '$skip': skip, + '$take': take, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.AdvSecEnablementStatus, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {boolean} enableOnCreateHost + */ + getEnableOnCreateHost(enableOnCreateHost) { + return __awaiter(this, void 0, void 0, function* () { + if (enableOnCreateHost == null) { + throw new TypeError('enableOnCreateHost can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + '$enableOnCreateHost': enableOnCreateHost, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {string} enableOnCreateProjectId + */ + getEnableOnCreateProject(enableOnCreateProjectId) { + return __awaiter(this, void 0, void 0, function* () { + if (enableOnCreateProjectId == null) { + throw new TypeError('enableOnCreateProjectId can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + '$enableOnCreateProjectId': enableOnCreateProjectId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {boolean} enableOnCreateHost + */ + setEnableOnCreateHost(enableOnCreateHost) { + return __awaiter(this, void 0, void 0, function* () { + if (enableOnCreateHost == null) { + throw new TypeError('enableOnCreateHost can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + '$enableOnCreateHost': enableOnCreateHost, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, null, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {string} enableOnCreateProjectId + * @param {boolean} enableOnStatus + */ + setEnableOnCreateProject(enableOnCreateProjectId, enableOnStatus) { + return __awaiter(this, void 0, void 0, function* () { + if (enableOnCreateProjectId == null) { + throw new TypeError('enableOnCreateProjectId can not be null or undefined'); + } + if (enableOnStatus == null) { + throw new TypeError('enableOnStatus can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + '$enableOnCreateProjectId': enableOnCreateProjectId, + '$enableOnStatus': enableOnStatus, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, null, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * POST Enablement status for repositories. + * + * @param {GitInterfaces.AdvSecEnablementUpdate[]} enablementUpdates + */ + updateEnablementStatus(enablementUpdates) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, enablementUpdates, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get estimated billable pushers for an Organization for last 90 days. + * + */ + getEstimatedBillablePushersOrg() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "2277ffbe-28d4-40d6-9c26-40baf26d1408", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get estimated billable pushers for a project for last 90 days. + * + * @param {string} project - Project ID or project name + */ + getEstimatedBillablePushersProject(project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1df7833e-1eed-447b-81a3-390c74923900", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get estimated billable committers for a repository for the last 90 days. + * + * @param {string} project - Project ID or project name + * @param {string} repositoryId + */ + getEstimatedBillableCommittersRepo(project, repositoryId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repositoryId: repositoryId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5dcec07b-a844-4efb-9fc1-968fd1f149db", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * GET Advanced Security Permission status. + * + * @param {string} projectName + * @param {string} repositoryId - Repository user is trying to access + * @param {string} permission - Permission being requestd, must be "viewAlert" "dismissAlert" "manage" "viewEnablement" or "repoRead" + */ + getPermission(projectName, repositoryId, permission) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + '$projectName': projectName, + '$repositoryId': repositoryId, + '$permission': permission, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "61b21a05-a60f-4910-a733-ba5347c2142d", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); } /** * Create an annotated tag. @@ -10975,7 +12207,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "5e8a8081-3851-4626-b677-9891cc04102e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5e8a8081-3851-4626-b677-9891cc04102e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11005,7 +12237,7 @@ class GitApi extends basem.ClientApiBase { objectId: objectId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "5e8a8081-3851-4626-b677-9891cc04102e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5e8a8081-3851-4626-b677-9891cc04102e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11019,6 +12251,75 @@ class GitApi extends basem.ClientApiBase { })); }); } + /** + * Retrieve actual billable committers for Advanced Security service for a given date. + * + * @param {string} project - Project ID or project name + * @param {Date} billingDate - UTC expected. If not specified defaults to the previous billing day. + * @param {number} skip - Skip X rows of resultset to simulate paging. + * @param {number} take - Return Y rows of resultset to simulate paging. + */ + getBillableCommitters(project, billingDate, skip, take) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + '$billingDate': billingDate, + '$skip': skip, + '$take': take, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5c5e3ebc-37b0-4547-a957-945912d44922", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Retrieve detailed actual billable committers for Advanced Security service for a given date. Detailed results intentionally does not filter out soft deleted projects and repositories to help diagnose billing issues. + * + * @param {string} project - Project ID or project name + * @param {string} includeDetails - Return all the details on the billable committers. + * @param {Date} billingDate - UTC expected. If not specified defaults to the previous billing day. + */ + getBillableCommittersDetail(project, includeDetails, billingDate) { + return __awaiter(this, void 0, void 0, function* () { + if (includeDetails == null) { + throw new TypeError('includeDetails can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + '$includeDetails': includeDetails, + '$billingDate': billingDate, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5c5e3ebc-37b0-4547-a957-945912d44922", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.BillableCommitterDetail, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** * Get a single blob. * @@ -11043,7 +12344,7 @@ class GitApi extends basem.ClientApiBase { resolveLfs: resolveLfs, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11081,7 +12382,7 @@ class GitApi extends basem.ClientApiBase { resolveLfs: resolveLfs, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -11112,11 +12413,11 @@ class GitApi extends basem.ClientApiBase { filename: filename, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + resolve((yield this.http.post(url, JSON.stringify(blobIds), { "Accept": accept, "Content-Type": "application/json" })).message); } catch (err) { reject(err); @@ -11148,7 +12449,7 @@ class GitApi extends basem.ClientApiBase { resolveLfs: resolveLfs, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/zip", apiVersion); @@ -11183,7 +12484,7 @@ class GitApi extends basem.ClientApiBase { baseVersionDescriptor: baseVersionDescriptor, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "d5b216de-d8d5-4d32-ae76-51df755b16d3", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "d5b216de-d8d5-4d32-ae76-51df755b16d3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11215,7 +12516,7 @@ class GitApi extends basem.ClientApiBase { baseVersionDescriptor: baseVersionDescriptor, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "d5b216de-d8d5-4d32-ae76-51df755b16d3", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "d5b216de-d8d5-4d32-ae76-51df755b16d3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11230,8 +12531,10 @@ class GitApi extends basem.ClientApiBase { }); } /** - * @param {GitInterfaces.GitQueryBranchStatsCriteria} searchCriteria - * @param {string} repositoryId + * Retrieve statistics for multiple commits + * + * @param {GitInterfaces.GitQueryBranchStatsCriteria} searchCriteria - Base Commit and List of Target Commits to compare. + * @param {string} repositoryId - The name or ID of the repository. * @param {string} project - Project ID or project name */ getBranchStatsBatch(searchCriteria, repositoryId, project) { @@ -11242,7 +12545,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "d5b216de-d8d5-4d32-ae76-51df755b16d3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "d5b216de-d8d5-4d32-ae76-51df755b16d3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11278,7 +12581,7 @@ class GitApi extends basem.ClientApiBase { skip: skip, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "5bf884f5-3e07-42e9-afb8-1b872267bf16", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5bf884f5-3e07-42e9-afb8-1b872267bf16", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11310,7 +12613,7 @@ class GitApi extends basem.ClientApiBase { conflictId: conflictId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11352,7 +12655,7 @@ class GitApi extends basem.ClientApiBase { includeObsolete: includeObsolete, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11385,7 +12688,7 @@ class GitApi extends basem.ClientApiBase { conflictId: conflictId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11416,7 +12719,7 @@ class GitApi extends basem.ClientApiBase { cherryPickId: cherryPickId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11450,7 +12753,7 @@ class GitApi extends basem.ClientApiBase { includeLinks: includeLinks, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "8af142a4-27c2-4168-9e82-46b8629aaa0d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "8af142a4-27c2-4168-9e82-46b8629aaa0d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11479,7 +12782,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "033bad68-9a14-43d1-90e0-59cb8856fef6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "033bad68-9a14-43d1-90e0-59cb8856fef6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11509,7 +12812,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "033bad68-9a14-43d1-90e0-59cb8856fef6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "033bad68-9a14-43d1-90e0-59cb8856fef6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11544,7 +12847,7 @@ class GitApi extends basem.ClientApiBase { refName: refName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "033bad68-9a14-43d1-90e0-59cb8856fef6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "033bad68-9a14-43d1-90e0-59cb8856fef6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11592,7 +12895,7 @@ class GitApi extends basem.ClientApiBase { queryValues.targetVersionOptions = targetVersionDescriptor.versionOptions; } try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "615588d5-c0c7-4b88-88f8-e625306446e8", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "615588d5-c0c7-4b88-88f8-e625306446e8", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11626,7 +12929,7 @@ class GitApi extends basem.ClientApiBase { changeCount: changeCount, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "c2570c3b-5b3f-41b8-98bf-5407bfde8d58", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "c2570c3b-5b3f-41b8-98bf-5407bfde8d58", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11665,7 +12968,7 @@ class GitApi extends basem.ClientApiBase { '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "c2570c3b-5b3f-41b8-98bf-5407bfde8d58", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "c2570c3b-5b3f-41b8-98bf-5407bfde8d58", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11706,7 +13009,7 @@ class GitApi extends basem.ClientApiBase { includeLinks: includeLinks, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "c2570c3b-5b3f-41b8-98bf-5407bfde8d58", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "c2570c3b-5b3f-41b8-98bf-5407bfde8d58", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11726,8 +13029,8 @@ class GitApi extends basem.ClientApiBase { * @param {GitInterfaces.GitQueryCommitsCriteria} searchCriteria - Search options * @param {string} repositoryId - The name or ID of the repository. * @param {string} project - Project ID or project name - * @param {number} skip - Number of commits to skip. - * @param {number} top - Maximum number of commits to return. + * @param {number} skip - Number of commits to skip. The value cannot exceed 3,000,000. + * @param {number} top - Maximum number of commits to return. The value cannot exceed 50,000. * @param {boolean} includeStatuses - True to include additional commit status information. */ getCommitsBatch(searchCriteria, repositoryId, project, skip, top, includeStatuses) { @@ -11743,7 +13046,7 @@ class GitApi extends basem.ClientApiBase { includeStatuses: includeStatuses, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "6400dfb2-0bcb-462b-b992-5a57f8f1416c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "6400dfb2-0bcb-462b-b992-5a57f8f1416c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11769,7 +13072,7 @@ class GitApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "2b6869c4-cb25-42b5-b7a3-0d3e6be0a11a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "2b6869c4-cb25-42b5-b7a3-0d3e6be0a11a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11798,7 +13101,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "c4c5a7e6-e9f3-4730-a92b-84baacff694b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "c4c5a7e6-e9f3-4730-a92b-84baacff694b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11832,7 +13135,7 @@ class GitApi extends basem.ClientApiBase { includeLinks: includeLinks, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "158c0340-bf6f-489c-9625-d572a1480d57", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "158c0340-bf6f-489c-9625-d572a1480d57", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11865,7 +13168,7 @@ class GitApi extends basem.ClientApiBase { includeLinks: includeLinks, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "1703f858-b9d1-46af-ab62-483e9e1055b5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1703f858-b9d1-46af-ab62-483e9e1055b5", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11899,7 +13202,7 @@ class GitApi extends basem.ClientApiBase { includeLinks: includeLinks, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "1703f858-b9d1-46af-ab62-483e9e1055b5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1703f858-b9d1-46af-ab62-483e9e1055b5", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11933,7 +13236,7 @@ class GitApi extends basem.ClientApiBase { includeLinks: includeLinks, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "1703f858-b9d1-46af-ab62-483e9e1055b5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1703f858-b9d1-46af-ab62-483e9e1055b5", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11947,6 +13250,258 @@ class GitApi extends basem.ClientApiBase { })); }); } + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. + * + * @param {string} repositoryId - The name or ID of the repository. + * @param {string} path - The item path. + * @param {string} project - Project ID or project name + * @param {string} scopePath - The path scope. The default is null. + * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - The recursion level of this request. The default is 'none', no recursion. + * @param {boolean} includeContentMetadata - Set to true to include content metadata. Default is false. + * @param {boolean} latestProcessedChange - Set to true to include the latest changes. Default is false. + * @param {boolean} download - Set to true to download the response as a file. Default is false. + * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - Version descriptor. Default is the default branch for the repository. + * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. + * @param {boolean} resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true. + * @param {boolean} sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false. + */ + getHfsItem(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveHfs, sanitize) { + return __awaiter(this, void 0, void 0, function* () { + if (path == null) { + throw new TypeError('path can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repositoryId: repositoryId + }; + let queryValues = { + path: path, + scopePath: scopePath, + recursionLevel: recursionLevel, + includeContentMetadata: includeContentMetadata, + latestProcessedChange: latestProcessedChange, + download: download, + versionDescriptor: versionDescriptor, + includeContent: includeContent, + resolveHfs: resolveHfs, + sanitize: sanitize, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "17f0a869-1589-43f0-9901-db1b2519087d", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitItem, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. + * + * @param {string} repositoryId - The name or ID of the repository. + * @param {string} path - The item path. + * @param {string} project - Project ID or project name + * @param {string} scopePath - The path scope. The default is null. + * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - The recursion level of this request. The default is 'none', no recursion. + * @param {boolean} includeContentMetadata - Set to true to include content metadata. Default is false. + * @param {boolean} latestProcessedChange - Set to true to include the latest changes. Default is false. + * @param {boolean} download - Set to true to download the response as a file. Default is false. + * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - Version descriptor. Default is the default branch for the repository. + * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. + * @param {boolean} resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true. + * @param {boolean} sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false. + */ + getHfsItemContent(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveHfs, sanitize) { + return __awaiter(this, void 0, void 0, function* () { + if (path == null) { + throw new TypeError('path can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repositoryId: repositoryId + }; + let queryValues = { + path: path, + scopePath: scopePath, + recursionLevel: recursionLevel, + includeContentMetadata: includeContentMetadata, + latestProcessedChange: latestProcessedChange, + download: download, + versionDescriptor: versionDescriptor, + includeContent: includeContent, + resolveHfs: resolveHfs, + sanitize: sanitize, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "17f0a869-1589-43f0-9901-db1b2519087d", routeValues, queryValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * + * @param {string} repositoryId - The name or ID of the repository. + * @param {string} project - Project ID or project name + * @param {string} scopePath - The path scope. The default is null. + * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - The recursion level of this request. The default is 'none', no recursion. + * @param {boolean} includeContentMetadata - Set to true to include content metadata. Default is false. + * @param {boolean} latestProcessedChange - Set to true to include the latest changes. Default is false. + * @param {boolean} download - Set to true to download the response as a file. Default is false. + * @param {boolean} includeLinks - Set to true to include links to items. Default is false. + * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - Version descriptor. Default is the default branch for the repository. + * @param {boolean} zipForUnix - Set to true to keep the file permissions for unix (and POSIX) systems like executables and symlinks + */ + getHfsItems(repositoryId, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, includeLinks, versionDescriptor, zipForUnix) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repositoryId: repositoryId + }; + let queryValues = { + scopePath: scopePath, + recursionLevel: recursionLevel, + includeContentMetadata: includeContentMetadata, + latestProcessedChange: latestProcessedChange, + download: download, + includeLinks: includeLinks, + versionDescriptor: versionDescriptor, + zipForUnix: zipForUnix, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "17f0a869-1589-43f0-9901-db1b2519087d", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitItem, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. + * + * @param {string} repositoryId - The name or ID of the repository. + * @param {string} path - The item path. + * @param {string} project - Project ID or project name + * @param {string} scopePath - The path scope. The default is null. + * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - The recursion level of this request. The default is 'none', no recursion. + * @param {boolean} includeContentMetadata - Set to true to include content metadata. Default is false. + * @param {boolean} latestProcessedChange - Set to true to include the latest changes. Default is false. + * @param {boolean} download - Set to true to download the response as a file. Default is false. + * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - Version descriptor. Default is the default branch for the repository. + * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. + * @param {boolean} resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true. + * @param {boolean} sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false. + */ + getHfsItemText(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveHfs, sanitize) { + return __awaiter(this, void 0, void 0, function* () { + if (path == null) { + throw new TypeError('path can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repositoryId: repositoryId + }; + let queryValues = { + path: path, + scopePath: scopePath, + recursionLevel: recursionLevel, + includeContentMetadata: includeContentMetadata, + latestProcessedChange: latestProcessedChange, + download: download, + versionDescriptor: versionDescriptor, + includeContent: includeContent, + resolveHfs: resolveHfs, + sanitize: sanitize, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "17f0a869-1589-43f0-9901-db1b2519087d", routeValues, queryValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. + * + * @param {string} repositoryId - The name or ID of the repository. + * @param {string} path - The item path. + * @param {string} project - Project ID or project name + * @param {string} scopePath - The path scope. The default is null. + * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - The recursion level of this request. The default is 'none', no recursion. + * @param {boolean} includeContentMetadata - Set to true to include content metadata. Default is false. + * @param {boolean} latestProcessedChange - Set to true to include the latest changes. Default is false. + * @param {boolean} download - Set to true to download the response as a file. Default is false. + * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - Version descriptor. Default is the default branch for the repository. + * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. + * @param {boolean} resolveHfs - Set to true to resolve Git HFS pointer files to return actual content from Git HFS. Default is true. + * @param {boolean} sanitize - Set to true to sanitize an svg file and return it as image. Useful only if requested for svg file. Default is false. + */ + getHfsItemZip(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveHfs, sanitize) { + return __awaiter(this, void 0, void 0, function* () { + if (path == null) { + throw new TypeError('path can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + repositoryId: repositoryId + }; + let queryValues = { + path: path, + scopePath: scopePath, + recursionLevel: recursionLevel, + includeContentMetadata: includeContentMetadata, + latestProcessedChange: latestProcessedChange, + download: download, + versionDescriptor: versionDescriptor, + includeContent: includeContent, + resolveHfs: resolveHfs, + sanitize: sanitize, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "17f0a869-1589-43f0-9901-db1b2519087d", routeValues, queryValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); + } + catch (err) { + reject(err); + } + })); + }); + } /** * Create an import request. * @@ -11962,7 +13517,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -11992,7 +13547,7 @@ class GitApi extends basem.ClientApiBase { importRequestId: importRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12024,7 +13579,7 @@ class GitApi extends basem.ClientApiBase { includeAbandoned: includeAbandoned, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12055,7 +13610,7 @@ class GitApi extends basem.ClientApiBase { importRequestId: importRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12108,7 +13663,7 @@ class GitApi extends basem.ClientApiBase { sanitize: sanitize, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12161,7 +13716,7 @@ class GitApi extends basem.ClientApiBase { sanitize: sanitize, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -12185,8 +13740,9 @@ class GitApi extends basem.ClientApiBase { * @param {boolean} download - Set to true to download the response as a file. Default is false. * @param {boolean} includeLinks - Set to true to include links to items. Default is false. * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - Version descriptor. Default is the default branch for the repository. + * @param {boolean} zipForUnix - Set to true to keep the file permissions for unix (and POSIX) systems like executables and symlinks */ - getItems(repositoryId, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, includeLinks, versionDescriptor) { + getItems(repositoryId, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, includeLinks, versionDescriptor, zipForUnix) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { @@ -12201,9 +13757,10 @@ class GitApi extends basem.ClientApiBase { download: download, includeLinks: includeLinks, versionDescriptor: versionDescriptor, + zipForUnix: zipForUnix, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12256,7 +13813,7 @@ class GitApi extends basem.ClientApiBase { sanitize: sanitize, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("text/plain", apiVersion); @@ -12307,7 +13864,7 @@ class GitApi extends basem.ClientApiBase { sanitize: sanitize, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/zip", apiVersion); @@ -12334,7 +13891,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "630fd2e4-fb88-4f85-ad21-13f3fd1fbca9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "630fd2e4-fb88-4f85-ad21-13f3fd1fbca9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12375,7 +13932,7 @@ class GitApi extends basem.ClientApiBase { otherRepositoryId: otherRepositoryId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "7cf2abb6-c964-4f7e-9872-f78c66e72e9c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "7cf2abb6-c964-4f7e-9872-f78c66e72e9c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12408,7 +13965,7 @@ class GitApi extends basem.ClientApiBase { includeLinks: includeLinks, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "985f7ae9-844f-4906-9897-7ef41516c0e2", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "985f7ae9-844f-4906-9897-7ef41516c0e2", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12442,7 +13999,7 @@ class GitApi extends basem.ClientApiBase { includeLinks: includeLinks, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "985f7ae9-844f-4906-9897-7ef41516c0e2", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "985f7ae9-844f-4906-9897-7ef41516c0e2", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12477,7 +14034,7 @@ class GitApi extends basem.ClientApiBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -12510,7 +14067,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12542,7 +14099,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/octet-stream", apiVersion); @@ -12570,7 +14127,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12602,7 +14159,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/zip", apiVersion); @@ -12634,7 +14191,7 @@ class GitApi extends basem.ClientApiBase { commentId: commentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "5f2e2851-1389-425b-a00b-fb2adb3ef31b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5f2e2851-1389-425b-a00b-fb2adb3ef31b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12668,7 +14225,7 @@ class GitApi extends basem.ClientApiBase { commentId: commentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "5f2e2851-1389-425b-a00b-fb2adb3ef31b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5f2e2851-1389-425b-a00b-fb2adb3ef31b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12702,7 +14259,7 @@ class GitApi extends basem.ClientApiBase { commentId: commentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "5f2e2851-1389-425b-a00b-fb2adb3ef31b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5f2e2851-1389-425b-a00b-fb2adb3ef31b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12740,7 +14297,7 @@ class GitApi extends basem.ClientApiBase { skip: skip, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "e7ea0883-095f-4926-b5fb-f24691c26fb9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "e7ea0883-095f-4926-b5fb-f24691c26fb9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12770,7 +14327,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "52823034-34a8-4576-922c-8d8b77e9e4c4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "52823034-34a8-4576-922c-8d8b77e9e4c4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12802,7 +14359,7 @@ class GitApi extends basem.ClientApiBase { conflictId: conflictId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12844,7 +14401,7 @@ class GitApi extends basem.ClientApiBase { onlyResolved: onlyResolved, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12877,7 +14434,7 @@ class GitApi extends basem.ClientApiBase { conflictId: conflictId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12908,7 +14465,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12948,7 +14505,7 @@ class GitApi extends basem.ClientApiBase { '$compareTo': compareTo, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "4216bdcf-b6b1-4d59-8b82-c34cc183fc8b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4216bdcf-b6b1-4d59-8b82-c34cc183fc8b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -12980,7 +14537,7 @@ class GitApi extends basem.ClientApiBase { iterationId: iterationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "d43911ee-6958-46b0-a42b-8445b8a0d004", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "d43911ee-6958-46b0-a42b-8445b8a0d004", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13014,7 +14571,7 @@ class GitApi extends basem.ClientApiBase { includeCommits: includeCommits, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "d43911ee-6958-46b0-a42b-8445b8a0d004", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "d43911ee-6958-46b0-a42b-8445b8a0d004", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13047,7 +14604,7 @@ class GitApi extends basem.ClientApiBase { iterationId: iterationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13081,7 +14638,7 @@ class GitApi extends basem.ClientApiBase { statusId: statusId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13115,7 +14672,7 @@ class GitApi extends basem.ClientApiBase { statusId: statusId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13147,7 +14704,7 @@ class GitApi extends basem.ClientApiBase { iterationId: iterationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13182,7 +14739,7 @@ class GitApi extends basem.ClientApiBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/json-patch+json"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -13198,7 +14755,7 @@ class GitApi extends basem.ClientApiBase { }); } /** - * Create a label for a specified pull request. The only required field is the name of the new label. + * Create a tag (if that does not exists yet) and add that as a label (tag) for a specified pull request. The only required field is the name of the new label (tag). * * @param {TfsCoreInterfaces.WebApiCreateTagRequestData} label - Label to assign to the pull request. * @param {string} repositoryId - The repository ID of the pull request’s target branch. @@ -13218,7 +14775,7 @@ class GitApi extends basem.ClientApiBase { projectId: projectId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13233,7 +14790,7 @@ class GitApi extends basem.ClientApiBase { }); } /** - * Removes a label from the set of those assigned to the pull request. + * Removes a label (tag) from the set of those assigned to the pull request. The tag itself will not be deleted. * * @param {string} repositoryId - The repository ID of the pull request’s target branch. * @param {number} pullRequestId - ID of the pull request. @@ -13254,7 +14811,7 @@ class GitApi extends basem.ClientApiBase { projectId: projectId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13269,7 +14826,7 @@ class GitApi extends basem.ClientApiBase { }); } /** - * Retrieves a single label that has been assigned to a pull request. + * Retrieves a single label (tag) that has been assigned to a pull request. * * @param {string} repositoryId - The repository ID of the pull request’s target branch. * @param {number} pullRequestId - ID of the pull request. @@ -13290,7 +14847,7 @@ class GitApi extends basem.ClientApiBase { projectId: projectId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13305,7 +14862,7 @@ class GitApi extends basem.ClientApiBase { }); } /** - * Get all the labels assigned to a pull request. + * Get all the labels (tags) assigned to a pull request. * * @param {string} repositoryId - The repository ID of the pull request’s target branch. * @param {number} pullRequestId - ID of the pull request. @@ -13324,7 +14881,7 @@ class GitApi extends basem.ClientApiBase { projectId: projectId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13354,7 +14911,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "48a52185-5b9e-4736-9dc1-bb1e2feac80b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "48a52185-5b9e-4736-9dc1-bb1e2feac80b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13387,7 +14944,7 @@ class GitApi extends basem.ClientApiBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/json-patch+json"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "48a52185-5b9e-4736-9dc1-bb1e2feac80b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "48a52185-5b9e-4736-9dc1-bb1e2feac80b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -13417,7 +14974,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "b3a6eebe-9cf0-49ea-b6cb-1a4c5f5007b0", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b3a6eebe-9cf0-49ea-b6cb-1a4c5f5007b0", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13450,7 +15007,7 @@ class GitApi extends basem.ClientApiBase { reviewerId: reviewerId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13481,7 +15038,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13512,7 +15069,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13544,7 +15101,7 @@ class GitApi extends basem.ClientApiBase { reviewerId: reviewerId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13576,7 +15133,7 @@ class GitApi extends basem.ClientApiBase { reviewerId: reviewerId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13606,7 +15163,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13639,7 +15196,7 @@ class GitApi extends basem.ClientApiBase { reviewerId: reviewerId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13670,7 +15227,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13698,7 +15255,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "01a46dea-7d46-4d40-bc84-319e7c260d99", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "01a46dea-7d46-4d40-bc84-319e7c260d99", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13737,7 +15294,7 @@ class GitApi extends basem.ClientApiBase { '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "a5d28130-9cd2-40fa-9f08-902e7daa9efb", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "a5d28130-9cd2-40fa-9f08-902e7daa9efb", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13770,7 +15327,7 @@ class GitApi extends basem.ClientApiBase { supportsIterations: supportsIterations, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13812,7 +15369,7 @@ class GitApi extends basem.ClientApiBase { includeWorkItemRefs: includeWorkItemRefs, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13853,7 +15410,7 @@ class GitApi extends basem.ClientApiBase { '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13884,7 +15441,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13915,7 +15472,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "696f3a82-47c9-487f-9117-b9d00972ca84", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "696f3a82-47c9-487f-9117-b9d00972ca84", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13946,7 +15503,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -13978,7 +15535,7 @@ class GitApi extends basem.ClientApiBase { statusId: statusId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14010,7 +15567,7 @@ class GitApi extends basem.ClientApiBase { statusId: statusId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14040,7 +15597,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14073,7 +15630,7 @@ class GitApi extends basem.ClientApiBase { customHeaders = customHeaders || {}; customHeaders["Content-Type"] = "application/json-patch+json"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); options.additionalHeaders = customHeaders; @@ -14107,7 +15664,7 @@ class GitApi extends basem.ClientApiBase { threadId: threadId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14141,7 +15698,7 @@ class GitApi extends basem.ClientApiBase { commentId: commentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14175,7 +15732,7 @@ class GitApi extends basem.ClientApiBase { commentId: commentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14207,7 +15764,7 @@ class GitApi extends basem.ClientApiBase { threadId: threadId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14242,7 +15799,7 @@ class GitApi extends basem.ClientApiBase { commentId: commentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14273,7 +15830,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14311,7 +15868,7 @@ class GitApi extends basem.ClientApiBase { '$baseIteration': baseIteration, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14347,7 +15904,7 @@ class GitApi extends basem.ClientApiBase { '$baseIteration': baseIteration, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14380,7 +15937,7 @@ class GitApi extends basem.ClientApiBase { threadId: threadId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14410,7 +15967,7 @@ class GitApi extends basem.ClientApiBase { pullRequestId: pullRequestId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "0a637fcc-5370-4ce8-b0e8-98091f5f9482", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "0a637fcc-5370-4ce8-b0e8-98091f5f9482", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14439,7 +15996,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "git", "ea98d07b-3c87-4971-8ede-a613694ffb55", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "git", "ea98d07b-3c87-4971-8ede-a613694ffb55", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14475,7 +16032,7 @@ class GitApi extends basem.ClientApiBase { includeRefUpdates: includeRefUpdates, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "git", "ea98d07b-3c87-4971-8ede-a613694ffb55", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "git", "ea98d07b-3c87-4971-8ede-a613694ffb55", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14511,7 +16068,7 @@ class GitApi extends basem.ClientApiBase { searchCriteria: searchCriteria, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "git", "ea98d07b-3c87-4971-8ede-a613694ffb55", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "git", "ea98d07b-3c87-4971-8ede-a613694ffb55", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14539,7 +16096,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "a663da97-81db-4eb3-8b83-287670f63073", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "a663da97-81db-4eb3-8b83-287670f63073", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14565,7 +16122,7 @@ class GitApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "a663da97-81db-4eb3-8b83-287670f63073", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "a663da97-81db-4eb3-8b83-287670f63073", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14594,7 +16151,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "a663da97-81db-4eb3-8b83-287670f63073", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "a663da97-81db-4eb3-8b83-287670f63073", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14638,7 +16195,7 @@ class GitApi extends basem.ClientApiBase { filterContains: filterContains, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "2d874a60-a811-4f62-9c9f-963a6ea0a55b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "2d874a60-a811-4f62-9c9f-963a6ea0a55b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14676,7 +16233,7 @@ class GitApi extends basem.ClientApiBase { projectId: projectId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "2d874a60-a811-4f62-9c9f-963a6ea0a55b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "2d874a60-a811-4f62-9c9f-963a6ea0a55b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14709,7 +16266,7 @@ class GitApi extends basem.ClientApiBase { projectId: projectId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "2d874a60-a811-4f62-9c9f-963a6ea0a55b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "2d874a60-a811-4f62-9c9f-963a6ea0a55b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14736,7 +16293,7 @@ class GitApi extends basem.ClientApiBase { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14764,7 +16321,7 @@ class GitApi extends basem.ClientApiBase { favoriteId: favoriteId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14792,7 +16349,7 @@ class GitApi extends basem.ClientApiBase { favoriteId: favoriteId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14824,7 +16381,35 @@ class GitApi extends basem.ClientApiBase { identityId: identityId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRefFavorite, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {string} project - Project ID or project name + * @param {string} identityId + */ + getRefFavoritesForProject(project, identityId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + identityId: identityId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4720896c-594c-4a6d-b94c-12eddd80b34a", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14855,7 +16440,7 @@ class GitApi extends basem.ClientApiBase { sourceRef: sourceRef, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14883,7 +16468,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14917,7 +16502,7 @@ class GitApi extends basem.ClientApiBase { includeHidden: includeHidden, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14945,7 +16530,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -14980,7 +16565,7 @@ class GitApi extends basem.ClientApiBase { includeParent: includeParent, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15009,7 +16594,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15023,6 +16608,46 @@ class GitApi extends basem.ClientApiBase { })); }); } + /** + * Retrieve git repositories with filter by name and pagination. + * + * @param {string} projectId - ID or name of the team project. + * @param {boolean} includeLinks - [optional] True to include reference links. The default value is false. + * @param {boolean} includeAllUrls - [optional] True to include all remote URLs. The default value is false. + * @param {boolean} includeHidden - [optional] True to include hidden repositories. The default value is false. + * @param {string} filterContains - [optional] A filter to apply to the refs (contains). + * @param {number} top - [optional] Maximum number of repositories to return. It cannot be bigger than 500. If it is not provided but continuationToken is, top will default to 100. + * @param {string} continuationToken - The continuation token used for pagination. + */ + getRepositoriesPaged(projectId, includeLinks, includeAllUrls, includeHidden, filterContains, top, continuationToken) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + projectId: projectId + }; + let queryValues = { + includeLinks: includeLinks, + includeAllUrls: includeAllUrls, + includeHidden: includeHidden, + filterContains: filterContains, + '$top': top, + continuationToken: continuationToken, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "82aea7e8-9501-45dd-ac58-b069aa73b926", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRepository, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** * Retrieve one conflict for a revert by ID * @@ -15041,7 +16666,7 @@ class GitApi extends basem.ClientApiBase { conflictId: conflictId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15083,7 +16708,7 @@ class GitApi extends basem.ClientApiBase { includeObsolete: includeObsolete, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15116,7 +16741,7 @@ class GitApi extends basem.ClientApiBase { conflictId: conflictId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15147,7 +16772,7 @@ class GitApi extends basem.ClientApiBase { revertId: revertId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15176,7 +16801,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "bc866058-5449-4715-9cf1-a510b6ff193c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "bc866058-5449-4715-9cf1-a510b6ff193c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15206,7 +16831,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "bc866058-5449-4715-9cf1-a510b6ff193c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "bc866058-5449-4715-9cf1-a510b6ff193c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15241,7 +16866,7 @@ class GitApi extends basem.ClientApiBase { refName: refName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "bc866058-5449-4715-9cf1-a510b6ff193c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "bc866058-5449-4715-9cf1-a510b6ff193c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15272,7 +16897,7 @@ class GitApi extends basem.ClientApiBase { repositoryId: repositoryId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "428dd4fb-fda5-4722-af02-9313b80305da", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "428dd4fb-fda5-4722-af02-9313b80305da", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15310,7 +16935,7 @@ class GitApi extends basem.ClientApiBase { latestOnly: latestOnly, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "428dd4fb-fda5-4722-af02-9313b80305da", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "428dd4fb-fda5-4722-af02-9313b80305da", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15329,16 +16954,20 @@ class GitApi extends basem.ClientApiBase { * * @param {string} repositoryId - ID of the git repository. * @param {string} project - Project ID or project name + * @param {boolean} preferCompareBranch - If true, prefer the compare branch over the default branch as target branch for pull requests. */ - getSuggestions(repositoryId, project) { + getSuggestions(repositoryId, project, preferCompareBranch) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, repositoryId: repositoryId }; + let queryValues = { + preferCompareBranch: preferCompareBranch, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "9393b4fb-4445-4919-972b-9ad16f442d83", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "9393b4fb-4445-4919-972b-9ad16f442d83", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15376,7 +17005,7 @@ class GitApi extends basem.ClientApiBase { fileName: fileName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "729f6437-6f92-44ec-8bee-273a7111063c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "729f6437-6f92-44ec-8bee-273a7111063c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15414,7 +17043,7 @@ class GitApi extends basem.ClientApiBase { fileName: fileName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "git", "729f6437-6f92-44ec-8bee-273a7111063c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "729f6437-6f92-44ec-8bee-273a7111063c", routeValues, queryValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; let accept = this.createAcceptHeader("application/zip", apiVersion); @@ -15427,8 +17056,8 @@ class GitApi extends basem.ClientApiBase { }); } } -GitApi.RESOURCE_AREA_ID = "4e080c62-fa21-4fbc-8fef-2a10a2b38049"; exports.GitApi = GitApi; +GitApi.RESOURCE_AREA_ID = "4e080c62-fa21-4fbc-8fef-2a10a2b38049"; /***/ }), @@ -15448,19 +17077,21 @@ exports.GitApi = GitApi; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LocationsApi = void 0; const basem = __nccwpck_require__(273); const LocationsInterfaces = __nccwpck_require__(3215); class LocationsApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Locations-api', options); + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Locations-api', options); } /** * This was copied and adapted from TeamFoundationConnectionService.Connect() @@ -15479,7 +17110,7 @@ class LocationsApi extends basem.ClientApiBase { lastChangeId64: lastChangeId64, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Location", "00d9565f-ed9c-4a06-9a50-00e7896ccab4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Location", "00d9565f-ed9c-4a06-9a50-00e7896ccab4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15497,8 +17128,9 @@ class LocationsApi extends basem.ClientApiBase { * @param {string} areaId * @param {string} enterpriseName * @param {string} organizationName + * @param {string} accessMapping */ - getResourceArea(areaId, enterpriseName, organizationName) { + getResourceArea(areaId, enterpriseName, organizationName, accessMapping) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { @@ -15507,9 +17139,10 @@ class LocationsApi extends basem.ClientApiBase { let queryValues = { enterpriseName: enterpriseName, organizationName: organizationName, + accessMapping: accessMapping, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Location", "e81700f7-3be2-46de-8624-2eb35882fcaa", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Location", "e81700f7-3be2-46de-8624-2eb35882fcaa", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15526,8 +17159,9 @@ class LocationsApi extends basem.ClientApiBase { /** * @param {string} areaId * @param {string} hostId + * @param {string} accessMapping */ - getResourceAreaByHost(areaId, hostId) { + getResourceAreaByHost(areaId, hostId, accessMapping) { return __awaiter(this, void 0, void 0, function* () { if (hostId == null) { throw new TypeError('hostId can not be null or undefined'); @@ -15538,9 +17172,46 @@ class LocationsApi extends basem.ClientApiBase { }; let queryValues = { hostId: hostId, + accessMapping: accessMapping, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Location", "e81700f7-3be2-46de-8624-2eb35882fcaa", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {string} areaId + * @param {string} instanceId + * @param {string} accessMapping + */ + getResourceAreaByInstanceId(areaId, instanceId, accessMapping) { + return __awaiter(this, void 0, void 0, function* () { + if (instanceId == null) { + throw new TypeError('instanceId can not be null or undefined'); + } + if (accessMapping == null) { + throw new TypeError('accessMapping can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + areaId: areaId + }; + let queryValues = { + instanceId: instanceId, + accessMapping: accessMapping, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Location", "e81700f7-3be2-46de-8624-2eb35882fcaa", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Location", "e81700f7-3be2-46de-8624-2eb35882fcaa", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15567,7 +17238,7 @@ class LocationsApi extends basem.ClientApiBase { organizationName: organizationName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Location", "e81700f7-3be2-46de-8624-2eb35882fcaa", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Location", "e81700f7-3be2-46de-8624-2eb35882fcaa", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15595,7 +17266,7 @@ class LocationsApi extends basem.ClientApiBase { hostId: hostId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Location", "e81700f7-3be2-46de-8624-2eb35882fcaa", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Location", "e81700f7-3be2-46de-8624-2eb35882fcaa", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15621,7 +17292,7 @@ class LocationsApi extends basem.ClientApiBase { identifier: identifier }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Location", "d810a47d-f4f4-4a62-a03f-fa1860585c4c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Location", "d810a47d-f4f4-4a62-a03f-fa1860585c4c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15655,7 +17326,7 @@ class LocationsApi extends basem.ClientApiBase { previewFaultIn: previewFaultIn, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Location", "d810a47d-f4f4-4a62-a03f-fa1860585c4c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Location", "d810a47d-f4f4-4a62-a03f-fa1860585c4c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15679,7 +17350,7 @@ class LocationsApi extends basem.ClientApiBase { serviceType: serviceType }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Location", "d810a47d-f4f4-4a62-a03f-fa1860585c4c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Location", "d810a47d-f4f4-4a62-a03f-fa1860585c4c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15701,7 +17372,7 @@ class LocationsApi extends basem.ClientApiBase { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Location", "d810a47d-f4f4-4a62-a03f-fa1860585c4c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Location", "d810a47d-f4f4-4a62-a03f-fa1860585c4c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -15721,7 +17392,7 @@ exports.LocationsApi = LocationsApi; /***/ }), -/***/ 8221: +/***/ 2190: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -15736,35 +17407,46 @@ exports.LocationsApi = LocationsApi; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ManagementApi = void 0; const basem = __nccwpck_require__(273); -const NotificationInterfaces = __nccwpck_require__(3044); -const VSSInterfaces = __nccwpck_require__(4498); -class NotificationApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Notification-api', options); +const ManagementInterfaces = __nccwpck_require__(9471); +class ManagementApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Management-api', options); } /** - * @param {NotificationInterfaces.BatchNotificationOperation} operation + * Determines if Code Security, Secret Protection, and their features are enabled for the repository. + * + * @param {string} project - Project ID or project name + * @param {string} repository - The name or ID of the repository + * @param {boolean} includeAllProperties - When true, will also determine if pushes are blocked when secrets are detected */ - performBatchNotificationOperations(operation) { + getRepoEnablementStatus2(project, repository, includeAllProperties) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + repository: repository + }; + let queryValues = { + includeAllProperties: includeAllProperties, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "8f3c6ab2-5bae-4537-b16e-f84e0955599e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "1fcb5ea0-1e19-4c71-ab26-0784bce2d551", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, operation, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.RepoEnablementSettings, false); resolve(ret); } catch (err) { @@ -15774,31 +17456,26 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Get a list of diagnostic logs for this service. + * Update the enablement status of Code Security and Secret Protection, along with their respective features, for a given repository. * - * @param {string} source - ID specifying which type of logs to check diagnostics for. - * @param {string} entryId - The ID of the specific log to query for. - * @param {Date} startTime - Start time for the time range to query in. - * @param {Date} endTime - End time for the time range to query in. + * @param {ManagementInterfaces.RepoEnablementSettings} savedAdvSecEnablementStatus - new status + * @param {string} project - Project ID or project name + * @param {string} repository - Name or ID of the repository */ - listLogs(source, entryId, startTime, endTime) { + updateRepoAdvSecEnablementStatus2(savedAdvSecEnablementStatus, project, repository) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - source: source, - entryId: entryId - }; - let queryValues = { - startTime: startTime, - endTime: endTime, + project: project, + repository: repository }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "991842f3-eb16-4aea-ac81-81353ef2b75c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "1fcb5ea0-1e19-4c71-ab26-0784bce2d551", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.INotificationDiagnosticLog, true); + res = yield this.rest.update(url, savedAdvSecEnablementStatus, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -15808,23 +17485,23 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Get the diagnostics settings for a subscription. + * During multi-org billing computation in primary scale unit(EUS21), this API is used to create billing snapshot for a specific org. Primary scale unit will call this API for each org in different scsle units to create billing snapshot. Data will be stored in the org specific partition DB -> billing snapshot table. This is needed as customers will fetch billing data from their org specific partition DB. * - * @param {string} subscriptionId - The id of the notifications subscription. + * @param {ManagementInterfaces.MeterUsage} meterUsage */ - getSubscriptionDiagnostics(subscriptionId) { + createBillingSnapshot(meterUsage) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - subscriptionId: subscriptionId + action: "Default", }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "20f1929d-4be7-4c2e-a74e-d47640ff3418", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "e58d8091-3d07-48b1-9527-7d6295fd4081", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.SubscriptionDiagnostics, false); + res = yield this.rest.create(url, meterUsage, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -15834,24 +17511,26 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Update the diagnostics settings for a subscription. + * Get all billable committers details, including those not matched with a VSID. * - * @param {NotificationInterfaces.UpdateSubscripitonDiagnosticsParameters} updateParameters - * @param {string} subscriptionId - The id of the notifications subscription. + * @param {Date} billingDate - The date to query, or if not provided, today */ - updateSubscriptionDiagnostics(updateParameters, subscriptionId) { + getBillableCommitterDetails(billingDate) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - subscriptionId: subscriptionId + action: "Details", + }; + let queryValues = { + billingDate: billingDate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "20f1929d-4be7-4c2e-a74e-d47640ff3418", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "e58d8091-3d07-48b1-9527-7d6295fd4081", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, updateParameters, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.SubscriptionDiagnostics, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.BillableCommitterDetails, true); resolve(ret); } catch (err) { @@ -15861,21 +17540,20 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Publish an event. This request must be directed to the service "extmgmt". - * - * @param {VSSInterfaces.VssNotificationEvent} notificationEvent */ - publishEvent(notificationEvent) { + getLastMeterUsage() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + action: "Last", + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "14c57b7a-c0e6-4555-9f51-e067188fdd8e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "e58d8091-3d07-48b1-9527-7d6295fd4081", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, notificationEvent, options); - let ret = this.formatResponse(res.result, VSSInterfaces.TypeInfo.VssNotificationEvent, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.MeterUsage, false); resolve(ret); } catch (err) { @@ -15885,21 +17563,26 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Tranform a notification event. + * Get commiters used when calculating billing information. * - * @param {NotificationInterfaces.EventTransformRequest} transformRequest - Object to be transformed. + * @param {Date} billingDate - The date to query, or if not provided, today */ - transformEvent(transformRequest) { + getMeterUsage(billingDate) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + action: "Default", + }; + let queryValues = { + billingDate: billingDate, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "9463a800-1b44-450e-9083-f948ea174b45", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "e58d8091-3d07-48b1-9527-7d6295fd4081", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, transformRequest, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.MeterUsage, false); resolve(ret); } catch (err) { @@ -15909,22 +17592,30 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * @param {NotificationInterfaces.FieldValuesQuery} inputValuesQuery - * @param {string} eventType + * During multi-org billing computation in primary scale unit(EUS21), this API is used to create billing snapshot for a specific org. Primary scale unit will call this API for each org in different scsle units to create billing snapshot. Data will be stored in the org specific partition DB -> billing snapshot table. This is needed as customers will fetch billing data from their org specific partition DB. + * + * @param {ManagementInterfaces.MeterUsageForPlan} meterUsage + * @param {ManagementInterfaces.Plan} plan */ - queryEventTypes(inputValuesQuery, eventType) { + createBillingSnapshot2(meterUsage, plan) { return __awaiter(this, void 0, void 0, function* () { + if (plan == null) { + throw new TypeError('plan can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - eventType: eventType + action: "Default", + }; + let queryValues = { + plan: plan, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "b5bbdd21-c178-4398-b6db-0166d910028a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "9615bfcf-d592-4664-9059-4be0150ff16d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, inputValuesQuery, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationEventField, true); + res = yield this.rest.create(url, meterUsage, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -15934,23 +17625,31 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Get a specific event type. + * Get all billable committers details, including those not matched with a VSID. * - * @param {string} eventType - The ID of the event type. + * @param {ManagementInterfaces.Plan} plan - The plan to query. Plans supported: CodeSecurity and SecretProtection. This is a mandatory parameter. + * @param {Date} billingDate - The date to query, or if not provided, today */ - getEventType(eventType) { + getBillableCommitterDetails2(plan, billingDate) { return __awaiter(this, void 0, void 0, function* () { + if (plan == null) { + throw new TypeError('plan can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - eventType: eventType + action: "Details", + }; + let queryValues = { + plan: plan, + billingDate: billingDate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "9615bfcf-d592-4664-9059-4be0150ff16d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationEventType, false); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.BillableCommitterDetails, true); resolve(ret); } catch (err) { @@ -15960,24 +17659,27 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * List available event types for this service. Optionally filter by only event types for the specified publisher. - * - * @param {string} publisherId - Limit to event types for this publisher + * @param {ManagementInterfaces.Plan} plan */ - listEventTypes(publisherId) { + getLastMeterUsage2(plan) { return __awaiter(this, void 0, void 0, function* () { + if (plan == null) { + throw new TypeError('plan can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + action: "Last", + }; let queryValues = { - publisherId: publisherId, + plan: plan, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "9615bfcf-d592-4664-9059-4be0150ff16d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationEventType, true); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.MeterUsageForPlan, false); resolve(ret); } catch (err) { @@ -15987,21 +17689,31 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * @param {number} notificationId + * Get commiters used when calculating billing information. + * + * @param {ManagementInterfaces.Plan} plan - The plan to query. Plans supported: CodeSecurity and SecretProtection. This is a mandatory parameter. + * @param {Date} billingDate - The date to query, or if not provided, today */ - getNotificationReasons(notificationId) { + getMeterUsage2(plan, billingDate) { return __awaiter(this, void 0, void 0, function* () { + if (plan == null) { + throw new TypeError('plan can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - notificationId: notificationId + action: "Default", + }; + let queryValues = { + plan: plan, + billingDate: billingDate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "19824fa9-1c76-40e6-9cce-cf0b9ca1cb60", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "9615bfcf-d592-4664-9059-4be0150ff16d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationReason, false); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.MeterUsageForPlan, false); resolve(ret); } catch (err) { @@ -16011,22 +17723,24 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * @param {number} notificationIds + * Get the current status of Advanced Security for the organization + * + * @param {boolean} includeAllProperties - When true, also determine if pushes are blocked if they contain secrets */ - listNotificationReasons(notificationIds) { + getOrgEnablementStatus(includeAllProperties) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; let queryValues = { - notificationIds: notificationIds, + includeAllProperties: includeAllProperties, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "19824fa9-1c76-40e6-9cce-cf0b9ca1cb60", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "d0c0450f-8882-46f4-a5a8-e48fea3095b0", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationReason, true); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.AdvSecEnablementSettings, false); resolve(ret); } catch (err) { @@ -16036,18 +17750,21 @@ class NotificationApi extends basem.ClientApiBase { }); } /** + * Update the status of Advanced Security for the organization + * + * @param {ManagementInterfaces.AdvSecEnablementSettingsUpdate} savedAdvSecEnablementStatus - The new status */ - getSettings() { + updateOrgEnablementStatus(savedAdvSecEnablementStatus) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "cbe076d8-2803-45ff-8d8d-44653686ea2a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "d0c0450f-8882-46f4-a5a8-e48fea3095b0", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationAdminSettings, false); + res = yield this.rest.update(url, savedAdvSecEnablementStatus, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -16057,19 +17774,24 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * @param {NotificationInterfaces.NotificationAdminSettingsUpdateParameters} updateParameters + * Get the current status of Advanced Security for the organization + * + * @param {boolean} includeAllProperties - When true, also determine if pushes are blocked if they contain secrets */ - updateSettings(updateParameters) { + getOrgEnablementStatus2(includeAllProperties) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; + let queryValues = { + includeAllProperties: includeAllProperties, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "cbe076d8-2803-45ff-8d8d-44653686ea2a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "41d7fd8d-71f1-485f-b48d-f68eb7f04a6b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, updateParameters, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationAdminSettings, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.OrgEnablementSettings, false); resolve(ret); } catch (err) { @@ -16079,23 +17801,21 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Get delivery preferences of a notifications subscriber. + * Update the status of Advanced Security for the organization * - * @param {string} subscriberId - ID of the user or group. + * @param {ManagementInterfaces.OrgEnablementSettings} orgEnablementSettings - The new status */ - getSubscriber(subscriberId) { + updateOrgEnablementStatus2(orgEnablementSettings) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - subscriberId: subscriberId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "4d5caff1-25ba-430b-b808-7a1f352cc197", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "41d7fd8d-71f1-485f-b48d-f68eb7f04a6b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscriber, false); + res = yield this.rest.update(url, orgEnablementSettings, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -16105,24 +17825,22 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Update delivery preferences of a notifications subscriber. + * Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this organization. * - * @param {NotificationInterfaces.NotificationSubscriberUpdateParameters} updateParameters - * @param {string} subscriberId - ID of the user or group. */ - updateSubscriber(updateParameters, subscriberId) { + getEstimatedBillablePushersDetailsForOrg() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - subscriberId: subscriberId + action: "Details", }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "4d5caff1-25ba-430b-b808-7a1f352cc197", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "10a9e9c3-89bf-4312-92ed-139ddbcd2e28", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, updateParameters, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscriber, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -16132,21 +17850,22 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Query for subscriptions. A subscription is returned if it matches one or more of the specified conditions. + * Estimate the committers that would be added to the customer's usage if Advanced Security was enabled for this organization. * - * @param {NotificationInterfaces.SubscriptionQuery} subscriptionQuery */ - querySubscriptions(subscriptionQuery) { + getEstimatedOrgBillablePushers() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + action: "Default", + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "6864db85-08c0-4006-8e8e-cc1bebe31675", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "10a9e9c3-89bf-4312-92ed-139ddbcd2e28", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, subscriptionQuery, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -16156,21 +17875,29 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Create a new subscription. + * Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this organization. * - * @param {NotificationInterfaces.NotificationSubscriptionCreateParameters} createParameters + * @param {ManagementInterfaces.Plan} plan - The plan to query. */ - createSubscription(createParameters) { + getEstimatedBillablePushersDetailsForOrg2(plan) { return __awaiter(this, void 0, void 0, function* () { + if (plan == null) { + throw new TypeError('plan can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + action: "Default", + }; + let queryValues = { + plan: plan, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "3fae4c8a-0597-45be-bf45-2925fe8036b3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, createParameters, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -16180,23 +17907,27 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Delete a subscription. + * Get the current status of Advanced Security for a project * - * @param {string} subscriptionId + * @param {string} project - Project ID or project name + * @param {boolean} includeAllProperties - When true, also determine if pushes are blocked if they contain secrets */ - deleteSubscription(subscriptionId) { + getProjectEnablementStatus(project, includeAllProperties) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - subscriptionId: subscriptionId + project: project + }; + let queryValues = { + includeAllProperties: includeAllProperties, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "6b9a4b47-5f2d-40f3-8286-b0152079074d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.AdvSecEnablementSettings, false); resolve(ret); } catch (err) { @@ -16206,27 +17937,24 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Get a notification subscription by its ID. + * Update the status of Advanced Security for the project * - * @param {string} subscriptionId - * @param {NotificationInterfaces.SubscriptionQueryFlags} queryFlags + * @param {ManagementInterfaces.AdvSecEnablementSettingsUpdate} savedAdvSecEnablementStatus - The new status + * @param {string} project - Project ID or project name */ - getSubscription(subscriptionId, queryFlags) { + updateProjectEnablementStatus(savedAdvSecEnablementStatus, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - subscriptionId: subscriptionId - }; - let queryValues = { - queryFlags: queryFlags, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "6b9a4b47-5f2d-40f3-8286-b0152079074d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, false); + res = yield this.rest.update(url, savedAdvSecEnablementStatus, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -16236,28 +17964,27 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Get a list of notification subscriptions, either by subscription IDs or by all subscriptions for a given user or group. + * Get the current status of Advanced Security for a project * - * @param {string} targetId - User or Group ID - * @param {string[]} ids - List of subscription IDs - * @param {NotificationInterfaces.SubscriptionQueryFlags} queryFlags + * @param {string} project - Project ID or project name + * @param {boolean} includeAllProperties - When true, also determine if pushes are blocked if they contain secrets */ - listSubscriptions(targetId, ids, queryFlags) { + getProjectEnablementStatus2(project, includeAllProperties) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project + }; let queryValues = { - targetId: targetId, - ids: ids && ids.join(","), - queryFlags: queryFlags, + includeAllProperties: includeAllProperties, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "534d98d2-d5a0-4bf4-94b3-1328019302f8", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, true); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.ProjectEnablementSettings, false); resolve(ret); } catch (err) { @@ -16267,24 +17994,24 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Update an existing subscription. Depending on the type of subscription and permissions, the caller can update the description, filter settings, channel (delivery) settings and more. + * Update the status of Advanced Security for the project * - * @param {NotificationInterfaces.NotificationSubscriptionUpdateParameters} updateParameters - * @param {string} subscriptionId + * @param {ManagementInterfaces.ProjectEnablementSettings} projectEnablementSettings - The new status + * @param {string} project - Project ID or project name */ - updateSubscription(updateParameters, subscriptionId) { + updateProjectEnablementStatus2(projectEnablementSettings, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - subscriptionId: subscriptionId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "534d98d2-d5a0-4bf4-94b3-1328019302f8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, updateParameters, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, false); + res = yield this.rest.update(url, projectEnablementSettings, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -16294,20 +18021,24 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Get available subscription templates. + * Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this project. * + * @param {string} project - Project ID or project name */ - getSubscriptionTemplates() { + getEstimatedBillablePushersDetailsForProject(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + action: "Details", + project: project + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "fa5d24ba-7484-4f3d-888d-4ec6b1974082", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "bf09cb40-ecf4-4496-8cf7-9ec60c64fd3e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscriptionTemplate, true); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -16317,26 +18048,24 @@ class NotificationApi extends basem.ClientApiBase { }); } /** - * Update the specified user's settings for the specified subscription. This API is typically used to opt in or out of a shared subscription. User settings can only be applied to shared subscriptions, like team subscriptions or default subscriptions. + * Estimate the number of committers that would be added to the customer's usage if Advanced Security was enabled for this project. * - * @param {NotificationInterfaces.SubscriptionUserSettings} userSettings - * @param {string} subscriptionId - * @param {string} userId - ID of the user + * @param {string} project - Project ID or project name */ - updateSubscriptionUserSettings(userSettings, subscriptionId, userId) { + getEstimatedBillablePushersForProject(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - subscriptionId: subscriptionId, - userId: userId + action: "Default", + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "notification", "ed5a3dff-aeb5-41b1-b4f7-89e66e58b62e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "bf09cb40-ecf4-4496-8cf7-9ec60c64fd3e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, userSettings, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -16345,62 +18074,29 @@ class NotificationApi extends basem.ClientApiBase { })); }); } -} -exports.NotificationApi = NotificationApi; - - -/***/ }), - -/***/ 266: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const PolicyInterfaces = __nccwpck_require__(8555); -class PolicyApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Policy-api', options); - } /** - * Create a policy configuration of a given policy type. + * Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this project. * - * @param {PolicyInterfaces.PolicyConfiguration} configuration - The policy configuration to create. * @param {string} project - Project ID or project name - * @param {number} configurationId + * @param {ManagementInterfaces.Plan} plan */ - createPolicyConfiguration(configuration, project, configurationId) { + getEstimatedBillablePushersDetailsForProject2(project, plan) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - configurationId: configurationId + action: "Default", + project: project + }; + let queryValues = { + plan: plan, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "dad91cbe-d183-45f8-9c6e-9c1164472121", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "ffd0d73d-54b4-4f56-9d83-e8b08db8bfcf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, configuration, options); - let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -16410,25 +18106,29 @@ class PolicyApi extends basem.ClientApiBase { }); } /** - * Delete a policy configuration by its ID. + * Determine if Advanced Security is enabled for a repository * * @param {string} project - Project ID or project name - * @param {number} configurationId - ID of the policy configuration to delete. + * @param {string} repository - The name or ID of the repository + * @param {boolean} includeAllProperties - When true, will also determine if pushes are blocked when secrets are detected */ - deletePolicyConfiguration(project, configurationId) { + getRepoEnablementStatus(project, repository, includeAllProperties) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - configurationId: configurationId + repository: repository + }; + let queryValues = { + includeAllProperties: includeAllProperties, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "dad91cbe-d183-45f8-9c6e-9c1164472121", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "d11a1c2b-b904-43dc-b970-bf42486262db", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.AdvSecEnablementStatus, false); resolve(ret); } catch (err) { @@ -16438,25 +18138,26 @@ class PolicyApi extends basem.ClientApiBase { }); } /** - * Get a policy configuration by its ID. + * Update the enablement of Advanced Security for a repository * + * @param {ManagementInterfaces.AdvSecEnablementStatusUpdate} savedAdvSecEnablementStatus - new status * @param {string} project - Project ID or project name - * @param {number} configurationId - ID of the policy configuration + * @param {string} repository - Name or ID of the repository */ - getPolicyConfiguration(project, configurationId) { + updateRepoAdvSecEnablementStatus(savedAdvSecEnablementStatus, project, repository) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - configurationId: configurationId + repository: repository }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "dad91cbe-d183-45f8-9c6e-9c1164472121", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "d11a1c2b-b904-43dc-b970-bf42486262db", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, false); + res = yield this.rest.update(url, savedAdvSecEnablementStatus, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -16466,29 +18167,26 @@ class PolicyApi extends basem.ClientApiBase { }); } /** - * Get a list of policy configurations in a project. + * Estimate the committers that would be added to the customer's usage if Advanced Security was enabled for this repository. * * @param {string} project - Project ID or project name - * @param {string} scope - [Provided for legacy reasons] The scope on which a subset of policies is defined. - * @param {string} policyType - Filter returned policies to only this type + * @param {string} repository */ - getPolicyConfigurations(project, scope, policyType) { + getEstimatedBillableCommitersDetailsForRepo(project, repository) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - scope: scope, - policyType: policyType, + action: "Details", + project: project, + repository: repository }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "dad91cbe-d183-45f8-9c6e-9c1164472121", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "b60f1ebf-ae77-4557-bd7f-ae3d5598dd1f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, true); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -16498,26 +18196,26 @@ class PolicyApi extends basem.ClientApiBase { }); } /** - * Update a policy configuration by its ID. + * Estimate the committers that would be added to the customer's usage if Advanced Security was enabled for this repository. * - * @param {PolicyInterfaces.PolicyConfiguration} configuration - The policy configuration to update. * @param {string} project - Project ID or project name - * @param {number} configurationId - ID of the existing policy configuration to be updated. + * @param {string} repository - The name or ID of the repository */ - updatePolicyConfiguration(configuration, project, configurationId) { + getEstimatedBillableCommittersForRepo(project, repository) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { + action: "Default", project: project, - configurationId: configurationId + repository: repository }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "dad91cbe-d183-45f8-9c6e-9c1164472121", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "b60f1ebf-ae77-4557-bd7f-ae3d5598dd1f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, configuration, options); - let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -16527,25 +18225,30 @@ class PolicyApi extends basem.ClientApiBase { }); } /** - * Gets the present evaluation state of a policy. + * Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this repository. * * @param {string} project - Project ID or project name - * @param {string} evaluationId - ID of the policy evaluation to be retrieved. + * @param {string} repository - The name or ID of the repository + * @param {ManagementInterfaces.Plan} plan - The plan to query. */ - getPolicyEvaluation(project, evaluationId) { + getEstimatedRepoBillableCommittersDetails2(project, repository, plan) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { + action: "Default", project: project, - evaluationId: evaluationId + repository: repository + }; + let queryValues = { + plan: plan, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "46aecb7a-5d2c-4647-897b-0209505a9fe4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "1a7b7e0d-e0b6-48b4-b0b6-9b6c2a1984e3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyEvaluationRecord, false); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -16554,26 +18257,58 @@ class PolicyApi extends basem.ClientApiBase { })); }); } +} +exports.ManagementApi = ManagementApi; + + +/***/ }), + +/***/ 8221: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NotificationApi = void 0; +const basem = __nccwpck_require__(273); +const NotificationInterfaces = __nccwpck_require__(3044); +const VSSInterfaces = __nccwpck_require__(4498); +class NotificationApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Notification-api', options); + } /** - * Requeue the policy evaluation. - * - * @param {string} project - Project ID or project name - * @param {string} evaluationId - ID of the policy evaluation to be retrieved. + * @param {NotificationInterfaces.BatchNotificationOperation} operation */ - requeuePolicyEvaluation(project, evaluationId) { + performBatchNotificationOperations(operation) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - evaluationId: evaluationId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "46aecb7a-5d2c-4647-897b-0209505a9fe4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "8f3c6ab2-5bae-4537-b16e-f84e0955599e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, null, options); - let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyEvaluationRecord, false); + res = yield this.rest.create(url, operation, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -16583,36 +18318,31 @@ class PolicyApi extends basem.ClientApiBase { }); } /** - * Retrieves a list of all the policy evaluation statuses for a specific pull request. + * Get a list of diagnostic logs for this service. * - * @param {string} project - Project ID or project name - * @param {string} artifactId - A string which uniquely identifies the target of a policy evaluation. - * @param {boolean} includeNotApplicable - Some policies might determine that they do not apply to a specific pull request. Setting this parameter to true will return evaluation records even for policies which don't apply to this pull request. - * @param {number} top - The number of policy evaluation records to retrieve. - * @param {number} skip - The number of policy evaluation records to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. + * @param {string} source - ID specifying which type of logs to check diagnostics for. + * @param {string} entryId - The ID of the specific log to query for. + * @param {Date} startTime - Start time for the time range to query in. + * @param {Date} endTime - End time for the time range to query in. */ - getPolicyEvaluations(project, artifactId, includeNotApplicable, top, skip) { + listLogs(source, entryId, startTime, endTime) { return __awaiter(this, void 0, void 0, function* () { - if (artifactId == null) { - throw new TypeError('artifactId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + source: source, + entryId: entryId }; let queryValues = { - artifactId: artifactId, - includeNotApplicable: includeNotApplicable, - '$top': top, - '$skip': skip, + startTime: startTime, + endTime: endTime, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "c23ddff5-229c-4d04-a80b-0fdce9f360c8", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "991842f3-eb16-4aea-ac81-81353ef2b75c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyEvaluationRecord, true); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.INotificationDiagnosticLog, true); resolve(ret); } catch (err) { @@ -16622,27 +18352,23 @@ class PolicyApi extends basem.ClientApiBase { }); } /** - * Retrieve a specific revision of a given policy by ID. + * Get the diagnostics settings for a subscription. * - * @param {string} project - Project ID or project name - * @param {number} configurationId - The policy configuration ID. - * @param {number} revisionId - The revision ID. + * @param {string} subscriptionId - The id of the notifications subscription. */ - getPolicyConfigurationRevision(project, configurationId, revisionId) { + getSubscriptionDiagnostics(subscriptionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - configurationId: configurationId, - revisionId: revisionId + subscriptionId: subscriptionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "fe1e68a2-60d3-43cb-855b-85e41ae97c95", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "20f1929d-4be7-4c2e-a74e-d47640ff3418", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, false); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.SubscriptionDiagnostics, false); resolve(ret); } catch (err) { @@ -16652,31 +18378,24 @@ class PolicyApi extends basem.ClientApiBase { }); } /** - * Retrieve all revisions for a given policy. + * Update the diagnostics settings for a subscription. * - * @param {string} project - Project ID or project name - * @param {number} configurationId - The policy configuration ID. - * @param {number} top - The number of revisions to retrieve. - * @param {number} skip - The number of revisions to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. + * @param {NotificationInterfaces.UpdateSubscripitonDiagnosticsParameters} updateParameters + * @param {string} subscriptionId - The id of the notifications subscription. */ - getPolicyConfigurationRevisions(project, configurationId, top, skip) { + updateSubscriptionDiagnostics(updateParameters, subscriptionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - configurationId: configurationId - }; - let queryValues = { - '$top': top, - '$skip': skip, + subscriptionId: subscriptionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "fe1e68a2-60d3-43cb-855b-85e41ae97c95", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "20f1929d-4be7-4c2e-a74e-d47640ff3418", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, true); + res = yield this.rest.replace(url, updateParameters, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.SubscriptionDiagnostics, false); resolve(ret); } catch (err) { @@ -16686,25 +18405,21 @@ class PolicyApi extends basem.ClientApiBase { }); } /** - * Retrieve a specific policy type by ID. + * Publish an event. This request must be directed to the service "extmgmt". * - * @param {string} project - Project ID or project name - * @param {string} typeId - The policy ID. + * @param {VSSInterfaces.VssNotificationEvent} notificationEvent */ - getPolicyType(project, typeId) { + publishEvent(notificationEvent) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - typeId: typeId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "44096322-2d3d-466a-bb30-d1b7de69f61f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "14c57b7a-c0e6-4555-9f51-e067188fdd8e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, notificationEvent, options); + let ret = this.formatResponse(res.result, VSSInterfaces.TypeInfo.VssNotificationEvent, false); resolve(ret); } catch (err) { @@ -16714,23 +18429,21 @@ class PolicyApi extends basem.ClientApiBase { }); } /** - * Retrieve all available policy types. + * Tranform a notification event. * - * @param {string} project - Project ID or project name + * @param {NotificationInterfaces.EventTransformRequest} transformRequest - Object to be transformed. */ - getPolicyTypes(project) { + transformEvent(transformRequest) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "policy", "44096322-2d3d-466a-bb30-d1b7de69f61f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "9463a800-1b44-450e-9083-f948ea174b45", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, transformRequest, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -16739,62 +18452,23 @@ class PolicyApi extends basem.ClientApiBase { })); }); } -} -PolicyApi.RESOURCE_AREA_ID = "fb13a388-40dd-4a04-b530-013a739c72ef"; -exports.PolicyApi = PolicyApi; - - -/***/ }), - -/***/ 8101: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* -* --------------------------------------------------------- -* Copyright(C) Microsoft Corporation. All rights reserved. -* --------------------------------------------------------- -* -* --------------------------------------------------------- -* Generated file, DO NOT EDIT -* --------------------------------------------------------- -*/ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const ProfileInterfaces = __nccwpck_require__(879); -class ProfileApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Profile-api', options); - } /** - * @param {string} id - * @param {string} descriptor - */ - deleteProfileAttribute(id, descriptor) { + * @param {NotificationInterfaces.FieldValuesQuery} inputValuesQuery + * @param {string} eventType + */ + queryEventTypes(inputValuesQuery, eventType) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - id: id - }; - let queryValues = { - descriptor: descriptor, + eventType: eventType }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.2", "Profile", "1392b6ac-d511-492e-af5b-2263e5545a5d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "b5bbdd21-c178-4398-b6db-0166d910028a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, inputValuesQuery, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationEventField, true); resolve(ret); } catch (err) { @@ -16804,25 +18478,23 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {string} id - * @param {string} descriptor - */ - getProfileAttribute(id, descriptor) { + * Get a specific event type. + * + * @param {string} eventType - The ID of the event type. + */ + getEventType(eventType) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - id: id - }; - let queryValues = { - descriptor: descriptor, + eventType: eventType }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.2", "Profile", "1392b6ac-d511-492e-af5b-2263e5545a5d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.ProfileAttribute, false); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationEventType, false); resolve(ret); } catch (err) { @@ -16832,33 +18504,24 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {string} id - * @param {string} partition - * @param {string} modifiedSince - * @param {string} modifiedAfterRevision - * @param {boolean} withCoreAttributes - * @param {string} coreAttributes - */ - getProfileAttributes(id, partition, modifiedSince, modifiedAfterRevision, withCoreAttributes, coreAttributes) { + * List available event types for this service. Optionally filter by only event types for the specified publisher. + * + * @param {string} publisherId - Limit to event types for this publisher + */ + listEventTypes(publisherId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - id: id - }; + let routeValues = {}; let queryValues = { - partition: partition, - modifiedSince: modifiedSince, - modifiedAfterRevision: modifiedAfterRevision, - withCoreAttributes: withCoreAttributes, - coreAttributes: coreAttributes, + publisherId: publisherId, }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.2", "Profile", "1392b6ac-d511-492e-af5b-2263e5545a5d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.ProfileAttribute, true); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationEventType, true); resolve(ret); } catch (err) { @@ -16868,26 +18531,21 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {any} container - * @param {string} id - * @param {string} descriptor - */ - setProfileAttribute(container, id, descriptor) { + * @param {number} notificationId + */ + getNotificationReasons(notificationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - id: id - }; - let queryValues = { - descriptor: descriptor, + notificationId: notificationId }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.2", "Profile", "1392b6ac-d511-492e-af5b-2263e5545a5d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "19824fa9-1c76-40e6-9cce-cf0b9ca1cb60", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, container, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationReason, false); resolve(ret); } catch (err) { @@ -16897,22 +18555,22 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {VSSInterfaces.VssJsonCollectionWrapperV[]>} attributesCollection - * @param {string} id - */ - setProfileAttributes(attributesCollection, id) { + * @param {number} notificationIds + */ + listNotificationReasons(notificationIds) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - id: id + let routeValues = {}; + let queryValues = { + notificationIds: notificationIds, }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.2", "Profile", "1392b6ac-d511-492e-af5b-2263e5545a5d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "19824fa9-1c76-40e6-9cce-cf0b9ca1cb60", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, attributesCollection, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationReason, true); resolve(ret); } catch (err) { @@ -16922,27 +18580,18 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {string} id - * @param {string} size - * @param {string} format - */ - getAvatar(id, size, format) { + */ + getSettings() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - id: id - }; - let queryValues = { - size: size, - format: format, - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "67436615-b382-462a-b659-5367a492fb3c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "cbe076d8-2803-45ff-8d8d-44653686ea2a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Avatar, false); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationAdminSettings, false); resolve(ret); } catch (err) { @@ -16952,30 +18601,19 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {any} container - * @param {string} id - * @param {string} size - * @param {string} format - * @param {string} displayName - */ - getAvatarPreview(container, id, size, format, displayName) { + * @param {NotificationInterfaces.NotificationAdminSettingsUpdateParameters} updateParameters + */ + updateSettings(updateParameters) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - id: id - }; - let queryValues = { - size: size, - format: format, - displayName: displayName, - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "67436615-b382-462a-b659-5367a492fb3c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "cbe076d8-2803-45ff-8d8d-44653686ea2a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, container, options); - let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Avatar, false); + res = yield this.rest.update(url, updateParameters, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationAdminSettings, false); resolve(ret); } catch (err) { @@ -16985,21 +18623,23 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {string} id - */ - resetAvatar(id) { + * Get delivery preferences of a notifications subscriber. + * + * @param {string} subscriberId - ID of the user or group. + */ + getSubscriber(subscriberId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - id: id + subscriberId: subscriberId }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "67436615-b382-462a-b659-5367a492fb3c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "4d5caff1-25ba-430b-b808-7a1f352cc197", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscriber, false); resolve(ret); } catch (err) { @@ -17009,22 +18649,24 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {any} container - * @param {string} id - */ - setAvatar(container, id) { + * Update delivery preferences of a notifications subscriber. + * + * @param {NotificationInterfaces.NotificationSubscriberUpdateParameters} updateParameters + * @param {string} subscriberId - ID of the user or group. + */ + updateSubscriber(updateParameters, subscriberId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - id: id + subscriberId: subscriberId }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "67436615-b382-462a-b659-5367a492fb3c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "4d5caff1-25ba-430b-b808-7a1f352cc197", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, container, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, updateParameters, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscriber, false); resolve(ret); } catch (err) { @@ -17034,24 +18676,21 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * Lookup up country/region based on provided IPv4, null if using the remote IPv4 address. - * - * @param {string} ipaddress - IPv4 address to be used for reverse lookup, null if using RemoteIPAddress in request context - */ - getGeoRegion(ipaddress) { + * Query for subscriptions. A subscription is returned if it matches one or more of the specified conditions. + * + * @param {NotificationInterfaces.SubscriptionQuery} subscriptionQuery + */ + querySubscriptions(subscriptionQuery) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; - let queryValues = { - ipaddress: ipaddress, - }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "3bcda9c0-3078-48a5-a1e0-83bd05931ad0", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "6864db85-08c0-4006-8e8e-cc1bebe31675", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, subscriptionQuery, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, true); resolve(ret); } catch (err) { @@ -17061,25 +18700,47 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * Create profile - * - * @param {ProfileInterfaces.CreateProfileContext} createProfileContext - Context for profile creation - * @param {boolean} autoCreate - Create profile automatically - */ - createProfile(createProfileContext, autoCreate) { + * Create a new subscription. + * + * @param {NotificationInterfaces.NotificationSubscriptionCreateParameters} createParameters + */ + createSubscription(createParameters) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; - let queryValues = { - autoCreate: autoCreate, + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, createParameters, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Delete a subscription. + * + * @param {string} subscriptionId + */ + deleteSubscription(subscriptionId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + subscriptionId: subscriptionId }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.3", "Profile", "f83735dc-483f-4238-a291-d45f6080a9af", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, createProfileContext, options); - let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Profile, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -17089,33 +18750,27 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {string} id - * @param {boolean} details - * @param {boolean} withAttributes - * @param {string} partition - * @param {string} coreAttributes - * @param {boolean} forceRefresh - */ - getProfile(id, details, withAttributes, partition, coreAttributes, forceRefresh) { + * Get a notification subscription by its ID. + * + * @param {string} subscriptionId + * @param {NotificationInterfaces.SubscriptionQueryFlags} queryFlags + */ + getSubscription(subscriptionId, queryFlags) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - id: id + subscriptionId: subscriptionId }; let queryValues = { - details: details, - withAttributes: withAttributes, - partition: partition, - coreAttributes: coreAttributes, - forceRefresh: forceRefresh, + queryFlags: queryFlags, }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.3", "Profile", "f83735dc-483f-4238-a291-d45f6080a9af", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Profile, false); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, false); resolve(ret); } catch (err) { @@ -17125,24 +18780,28 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * Update profile - * - * @param {ProfileInterfaces.Profile} profile - Update profile - * @param {string} id - Profile ID - */ - updateProfile(profile, id) { + * Get a list of notification subscriptions, either by subscription IDs or by all subscriptions for a given user or group. + * + * @param {string} targetId - User or Group ID + * @param {string[]} ids - List of subscription IDs + * @param {NotificationInterfaces.SubscriptionQueryFlags} queryFlags + */ + listSubscriptions(targetId, ids, queryFlags) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - id: id + let routeValues = {}; + let queryValues = { + targetId: targetId, + ids: ids && ids.join(","), + queryFlags: queryFlags, }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.3", "Profile", "f83735dc-483f-4238-a291-d45f6080a9af", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, profile, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, true); resolve(ret); } catch (err) { @@ -17152,18 +18811,24 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - */ - getRegions() { + * Update an existing subscription. Depending on the type of subscription and permissions, the caller can update the description, filter settings, channel (delivery) settings and more. + * + * @param {NotificationInterfaces.NotificationSubscriptionUpdateParameters} updateParameters + * @param {string} subscriptionId + */ + updateSubscription(updateParameters, subscriptionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + subscriptionId: subscriptionId + }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "92d8d1c9-26b8-4774-a929-d640a73da524", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, updateParameters, options); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, false); resolve(ret); } catch (err) { @@ -17173,18 +18838,20 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - */ - getSupportedLcids() { + * Get available subscription templates. + * + */ + getSubscriptionTemplates() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "d5bd1aa6-c269-4bcd-ad32-75fa17475584", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "fa5d24ba-7484-4f3d-888d-4ec6b1974082", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscriptionTemplate, true); resolve(ret); } catch (err) { @@ -17194,22 +18861,21 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {boolean} includeAvatar - */ - getUserDefaults(includeAvatar) { + * Publish an event. This request is only for the Token service since it's a deploy only service. + * + * @param {VSSInterfaces.VssNotificationEvent} notificationEvent + */ + publishTokenEvent(notificationEvent) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; - let queryValues = { - includeAvatar: includeAvatar, - }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "b583a356-1da7-4237-9f4c-1deb2edbc7e8", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "31dc86a2-67e8-4452-99a4-2b301ba28291", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Profile, false); + res = yield this.rest.create(url, notificationEvent, options); + let ret = this.formatResponse(res.result, VSSInterfaces.TypeInfo.VssNotificationEvent, false); resolve(ret); } catch (err) { @@ -17219,21 +18885,26 @@ class ProfileApi extends basem.ClientApiBase { }); } /** - * @param {string} id - */ - refreshUserDefaults(id) { + * Update the specified user's settings for the specified subscription. This API is typically used to opt in or out of a shared subscription. User settings can only be applied to shared subscriptions, like team subscriptions or default subscriptions. + * + * @param {NotificationInterfaces.SubscriptionUserSettings} userSettings + * @param {string} subscriptionId + * @param {string} userId - ID of the user + */ + updateSubscriptionUserSettings(userSettings, subscriptionId, userId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - id: id + subscriptionId: subscriptionId, + userId: userId }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "b583a356-1da7-4237-9f4c-1deb2edbc7e8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "ed5a3dff-aeb5-41b1-b4f7-89e66e58b62e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, options); - let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Profile, false); + res = yield this.rest.replace(url, userSettings, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -17243,12 +18914,12 @@ class ProfileApi extends basem.ClientApiBase { }); } } -exports.ProfileApi = ProfileApi; +exports.NotificationApi = NotificationApi; /***/ }), -/***/ 1682: +/***/ 686: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -17263,36 +18934,53 @@ exports.ProfileApi = ProfileApi; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PipelinesApi = void 0; const basem = __nccwpck_require__(273); -const ProjectAnalysisInterfaces = __nccwpck_require__(4323); -class ProjectAnalysisApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-ProjectAnalysis-api', options); +const PipelinesInterfaces = __nccwpck_require__(5871); +class PipelinesApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Pipelines-api', options); } /** + * Get a specific artifact from a pipeline run + * * @param {string} project - Project ID or project name + * @param {number} pipelineId - ID of the pipeline. + * @param {number} runId - ID of the run of that pipeline. + * @param {string} artifactName - Name of the artifact. + * @param {PipelinesInterfaces.GetArtifactExpandOptions} expand - Expand options. Default is None. */ - getProjectLanguageAnalytics(project) { + getArtifact(project, pipelineId, runId, artifactName, expand) { return __awaiter(this, void 0, void 0, function* () { + if (artifactName == null) { + throw new TypeError('artifactName can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + pipelineId: pipelineId, + runId: runId + }; + let queryValues = { + artifactName: artifactName, + '$expand': expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "projectanalysis", "5b02a779-1867-433f-90b7-d23ed5e33e57", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "85023071-bd5e-4438-89b0-2a5bf362a19d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ProjectAnalysisInterfaces.TypeInfo.ProjectLanguageAnalytics, false); + let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Artifact, false); resolve(ret); } catch (err) { @@ -17302,33 +18990,33 @@ class ProjectAnalysisApi extends basem.ClientApiBase { }); } /** + * Get a specific log from a pipeline run + * * @param {string} project - Project ID or project name - * @param {Date} fromDate - * @param {ProjectAnalysisInterfaces.AggregationType} aggregationType + * @param {number} pipelineId - ID of the pipeline. + * @param {number} runId - ID of the run of that pipeline. + * @param {number} logId - ID of the log. + * @param {PipelinesInterfaces.GetLogExpandOptions} expand - Expand options. Default is None. */ - getProjectActivityMetrics(project, fromDate, aggregationType) { + getLog(project, pipelineId, runId, logId, expand) { return __awaiter(this, void 0, void 0, function* () { - if (fromDate == null) { - throw new TypeError('fromDate can not be null or undefined'); - } - if (aggregationType == null) { - throw new TypeError('aggregationType can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + pipelineId: pipelineId, + runId: runId, + logId: logId }; let queryValues = { - fromDate: fromDate, - aggregationType: aggregationType, + '$expand': expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "projectanalysis", "e40ae584-9ea6-4f06-a7c7-6284651b466b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "fb1b6d27-3957-43d5-a14b-a2d70403e545", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ProjectAnalysisInterfaces.TypeInfo.ProjectActivityMetrics, false); + let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Log, false); resolve(ret); } catch (err) { @@ -17338,45 +19026,31 @@ class ProjectAnalysisApi extends basem.ClientApiBase { }); } /** - * Retrieves git activity metrics for repositories matching a specified criteria. + * Get a list of logs from a pipeline run. * * @param {string} project - Project ID or project name - * @param {Date} fromDate - Date from which, the trends are to be fetched. - * @param {ProjectAnalysisInterfaces.AggregationType} aggregationType - Bucket size on which, trends are to be aggregated. - * @param {number} skip - The number of repositories to ignore. - * @param {number} top - The number of repositories for which activity metrics are to be retrieved. + * @param {number} pipelineId - ID of the pipeline. + * @param {number} runId - ID of the run of that pipeline. + * @param {PipelinesInterfaces.GetLogExpandOptions} expand - Expand options. Default is None. */ - getGitRepositoriesActivityMetrics(project, fromDate, aggregationType, skip, top) { + listLogs(project, pipelineId, runId, expand) { return __awaiter(this, void 0, void 0, function* () { - if (fromDate == null) { - throw new TypeError('fromDate can not be null or undefined'); - } - if (aggregationType == null) { - throw new TypeError('aggregationType can not be null or undefined'); - } - if (skip == null) { - throw new TypeError('skip can not be null or undefined'); - } - if (top == null) { - throw new TypeError('top can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + pipelineId: pipelineId, + runId: runId }; let queryValues = { - fromDate: fromDate, - aggregationType: aggregationType, - '$skip': skip, - '$top': top, + '$expand': expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "projectanalysis", "df7fbbca-630a-40e3-8aa3-7a3faf66947e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "fb1b6d27-3957-43d5-a14b-a2d70403e545", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ProjectAnalysisInterfaces.TypeInfo.RepositoryActivityMetrics, true); + let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.LogCollection, false); resolve(ret); } catch (err) { @@ -17386,35 +19060,24 @@ class ProjectAnalysisApi extends basem.ClientApiBase { }); } /** + * Create a pipeline. + * + * @param {PipelinesInterfaces.CreatePipelineParameters} inputParameters - Input parameters. * @param {string} project - Project ID or project name - * @param {string} repositoryId - * @param {Date} fromDate - * @param {ProjectAnalysisInterfaces.AggregationType} aggregationType */ - getRepositoryActivityMetrics(project, repositoryId, fromDate, aggregationType) { + createPipeline(inputParameters, project) { return __awaiter(this, void 0, void 0, function* () { - if (fromDate == null) { - throw new TypeError('fromDate can not be null or undefined'); - } - if (aggregationType == null) { - throw new TypeError('aggregationType can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - repositoryId: repositoryId - }; - let queryValues = { - fromDate: fromDate, - aggregationType: aggregationType, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "projectanalysis", "df7fbbca-630a-40e3-8aa3-7a3faf66947e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "28e1305e-2afe-47bf-abaf-cbb0e6a91988", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ProjectAnalysisInterfaces.TypeInfo.RepositoryActivityMetrics, false); + res = yield this.rest.create(url, inputParameters, options); + let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Pipeline, false); resolve(ret); } catch (err) { @@ -17423,62 +19086,30 @@ class ProjectAnalysisApi extends basem.ClientApiBase { })); }); } -} -ProjectAnalysisApi.RESOURCE_AREA_ID = "7658fa33-b1bf-4580-990f-fac5896773d3"; -exports.ProjectAnalysisApi = ProjectAnalysisApi; - - -/***/ }), - -/***/ 3075: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const ReleaseInterfaces = __nccwpck_require__(7421); -class ReleaseApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Release-api', options); - } /** - * Returns the artifact details that automation agent requires + * Gets a pipeline, optionally at the specified version * * @param {string} project - Project ID or project name - * @param {number} releaseId + * @param {number} pipelineId - The pipeline ID + * @param {number} pipelineVersion - The pipeline version */ - getAgentArtifactDefinitions(project, releaseId) { + getPipeline(project, pipelineId, pipelineVersion) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId + pipelineId: pipelineId + }; + let queryValues = { + pipelineVersion: pipelineVersion, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "f2571c27-bf50-4938-b396-32d109ddef26", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "28e1305e-2afe-47bf-abaf-cbb0e6a91988", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.AgentArtifactDefinition, true); + let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Pipeline, false); resolve(ret); } catch (err) { @@ -17488,41 +19119,31 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get a list of approvals + * Get a list of pipelines. * * @param {string} project - Project ID or project name - * @param {string} assignedToFilter - Approvals assigned to this user. - * @param {ReleaseInterfaces.ApprovalStatus} statusFilter - Approvals with this status. Default is 'pending'. - * @param {number[]} releaseIdsFilter - Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4. - * @param {ReleaseInterfaces.ApprovalType} typeFilter - Approval with this type. - * @param {number} top - Number of approvals to get. Default is 50. - * @param {number} continuationToken - Gets the approvals after the continuation token provided. - * @param {ReleaseInterfaces.ReleaseQueryOrder} queryOrder - Gets the results in the defined order of created approvals. Default is 'descending'. - * @param {boolean} includeMyGroupApprovals - 'true' to include my group approvals. Default is 'false'. + * @param {string} orderBy - A sort expression. Defaults to "name asc" + * @param {number} top - The maximum number of pipelines to return + * @param {string} continuationToken - A continuation token from a previous request, to retrieve the next page of results */ - getApprovals(project, assignedToFilter, statusFilter, releaseIdsFilter, typeFilter, top, continuationToken, queryOrder, includeMyGroupApprovals) { + listPipelines(project, orderBy, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; let queryValues = { - assignedToFilter: assignedToFilter, - statusFilter: statusFilter, - releaseIdsFilter: releaseIdsFilter && releaseIdsFilter.join(","), - typeFilter: typeFilter, - top: top, + orderBy: orderBy, + '$top': top, continuationToken: continuationToken, - queryOrder: queryOrder, - includeMyGroupApprovals: includeMyGroupApprovals, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Release", "b47c6458-e73b-47cb-a770-4df1e8813a91", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "28e1305e-2afe-47bf-abaf-cbb0e6a91988", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseApproval, true); + let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Pipeline, true); resolve(ret); } catch (err) { @@ -17532,25 +19153,30 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get approval history. + * Queues a dry run of the pipeline and returns an object containing the final yaml. * + * @param {PipelinesInterfaces.RunPipelineParameters} runParameters - Optional additional parameters for this run. * @param {string} project - Project ID or project name - * @param {number} approvalStepId - Id of the approval. + * @param {number} pipelineId - The pipeline ID. + * @param {number} pipelineVersion - The pipeline version. */ - getApprovalHistory(project, approvalStepId) { + preview(runParameters, project, pipelineId, pipelineVersion) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - approvalStepId: approvalStepId + pipelineId: pipelineId + }; + let queryValues = { + pipelineVersion: pipelineVersion, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Release", "250c7158-852e-4130-a00f-a0cce9b72d05", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "53df2d18-29ea-46a9-bee0-933540f80abf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseApproval, false); + res = yield this.rest.create(url, runParameters, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -17560,29 +19186,27 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get an approval. + * Gets a run for a particular pipeline. * * @param {string} project - Project ID or project name - * @param {number} approvalId - Id of the approval. - * @param {boolean} includeHistory - 'true' to include history of the approval. Default is 'false'. + * @param {number} pipelineId - The pipeline id + * @param {number} runId - The run id */ - getApproval(project, approvalId, includeHistory) { + getRun(project, pipelineId, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - approvalId: approvalId - }; - let queryValues = { - includeHistory: includeHistory, + pipelineId: pipelineId, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Release", "9328e074-59fb-465a-89d9-b09c82ee5109", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "7859261e-d2e9-4a68-b820-a5d84cc5bb3d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseApproval, false); + let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Run, false); resolve(ret); } catch (err) { @@ -17592,26 +19216,25 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Update status of an approval + * Gets top 10000 runs for a particular pipeline. * - * @param {ReleaseInterfaces.ReleaseApproval} approval - ReleaseApproval object having status, approver and comments. * @param {string} project - Project ID or project name - * @param {number} approvalId - Id of the approval. + * @param {number} pipelineId - The pipeline id */ - updateReleaseApproval(approval, project, approvalId) { + listRuns(project, pipelineId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - approvalId: approvalId + pipelineId: pipelineId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Release", "9328e074-59fb-465a-89d9-b09c82ee5109", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "7859261e-d2e9-4a68-b820-a5d84cc5bb3d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, approval, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseApproval, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Run, true); resolve(ret); } catch (err) { @@ -17621,22 +19244,30 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {ReleaseInterfaces.ReleaseApproval[]} approvals + * Runs a pipeline. + * + * @param {PipelinesInterfaces.RunPipelineParameters} runParameters - Optional additional parameters for this run. * @param {string} project - Project ID or project name + * @param {number} pipelineId - The pipeline ID. + * @param {number} pipelineVersion - The pipeline version. */ - updateReleaseApprovals(approvals, project) { + runPipeline(runParameters, project, pipelineId, pipelineVersion) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + pipelineId: pipelineId + }; + let queryValues = { + pipelineVersion: pipelineVersion, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Release", "c957584a-82aa-4131-8222-6d47f78bfa7a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "7859261e-d2e9-4a68-b820-a5d84cc5bb3d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, approvals, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseApproval, true); + res = yield this.rest.create(url, runParameters, options); + let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Run, false); resolve(ret); } catch (err) { @@ -17645,77 +19276,63 @@ class ReleaseApi extends basem.ClientApiBase { })); }); } - /** - * Get a task attachment. - * - * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {number} environmentId - Id of the release environment. - * @param {number} attemptId - Attempt number of deployment. - * @param {string} timelineId - Timeline Id of the task. - * @param {string} recordId - Record Id of attachment. - * @param {string} type - Type of the attachment. - * @param {string} name - Name of the attachment. - */ - getTaskAttachmentContent(project, releaseId, environmentId, attemptId, timelineId, recordId, type, name) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - releaseId: releaseId, - environmentId: environmentId, - attemptId: attemptId, - timelineId: timelineId, - recordId: recordId, - type: type, - name: name - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "c4071f6d-3697-46ca-858e-8b10ff09e52f", routeValues); - let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); - } - catch (err) { - reject(err); - } - })); - }); +} +exports.PipelinesApi = PipelinesApi; + + +/***/ }), + +/***/ 266: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PolicyApi = void 0; +const basem = __nccwpck_require__(273); +const PolicyInterfaces = __nccwpck_require__(8555); +class PolicyApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Policy-api', options); } /** - * Get a release task attachment. + * Create a policy configuration of a given policy type. * + * @param {PolicyInterfaces.PolicyConfiguration} configuration - The policy configuration to create. * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {number} environmentId - Id of the release environment. - * @param {number} attemptId - Attempt number of deployment. - * @param {string} planId - Plan Id of the deploy phase. - * @param {string} timelineId - Timeline Id of the task. - * @param {string} recordId - Record Id of attachment. - * @param {string} type - Type of the attachment. - * @param {string} name - Name of the attachment. */ - getReleaseTaskAttachmentContent(project, releaseId, environmentId, attemptId, planId, timelineId, recordId, type, name) { + createPolicyConfiguration(configuration, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - releaseId: releaseId, - environmentId: environmentId, - attemptId: attemptId, - planId: planId, - timelineId: timelineId, - recordId: recordId, - type: type, - name: name + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "60b86efb-7b8c-4853-8f9f-aa142b77b479", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "dad91cbe-d183-45f8-9c6e-9c1164472121", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, configuration, options); + let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, false); + resolve(ret); } catch (err) { reject(err); @@ -17724,33 +19341,25 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get the task attachments. + * Delete a policy configuration by its ID. * * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {number} environmentId - Id of the release environment. - * @param {number} attemptId - Attempt number of deployment. - * @param {string} timelineId - Timeline Id of the task. - * @param {string} type - Type of the attachment. + * @param {number} configurationId - ID of the policy configuration to delete. */ - getTaskAttachments(project, releaseId, environmentId, attemptId, timelineId, type) { + deletePolicyConfiguration(project, configurationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId, - environmentId: environmentId, - attemptId: attemptId, - timelineId: timelineId, - type: type + configurationId: configurationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "214111ee-2415-4df2-8ed2-74417f7d61f9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "dad91cbe-d183-45f8-9c6e-9c1164472121", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseTaskAttachment, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -17760,33 +19369,25 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get the release task attachments. + * Get a policy configuration by its ID. * * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {number} environmentId - Id of the release environment. - * @param {number} attemptId - Attempt number of deployment. - * @param {string} planId - Plan Id of the deploy phase. - * @param {string} type - Type of the attachment. + * @param {number} configurationId - ID of the policy configuration */ - getReleaseTaskAttachments(project, releaseId, environmentId, attemptId, planId, type) { + getPolicyConfiguration(project, configurationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId, - environmentId: environmentId, - attemptId: attemptId, - planId: planId, - type: type + configurationId: configurationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "a4d06688-0dfa-4895-82a5-f43ec9452306", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "dad91cbe-d183-45f8-9c6e-9c1164472121", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseTaskAttachment, true); + let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, false); resolve(ret); } catch (err) { @@ -17796,38 +19397,29 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {string} artifactType - * @param {string} sourceId - * @param {string} artifactVersionId + * Get a list of policy configurations in a project. + * * @param {string} project - Project ID or project name + * @param {string} scope - [Provided for legacy reasons] The scope on which a subset of policies is defined. + * @param {string} policyType - Filter returned policies to only this type */ - getAutoTriggerIssues(artifactType, sourceId, artifactVersionId, project) { + getPolicyConfigurations(project, scope, policyType) { return __awaiter(this, void 0, void 0, function* () { - if (artifactType == null) { - throw new TypeError('artifactType can not be null or undefined'); - } - if (sourceId == null) { - throw new TypeError('sourceId can not be null or undefined'); - } - if (artifactVersionId == null) { - throw new TypeError('artifactVersionId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; let queryValues = { - artifactType: artifactType, - sourceId: sourceId, - artifactVersionId: artifactVersionId, + scope: scope, + policyType: policyType, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "c1a68497-69da-40fb-9423-cab19cfeeca9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "dad91cbe-d183-45f8-9c6e-9c1164472121", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.AutoTriggerIssue, true); + let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, true); resolve(ret); } catch (err) { @@ -17837,29 +19429,26 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets a badge that indicates the status of the most recent deployment for an environment. + * Update a policy configuration by its ID. * - * @param {string} projectId - The ID of the Project. - * @param {number} releaseDefinitionId - The ID of the Release Definition. - * @param {number} environmentId - The ID of the Environment. - * @param {string} branchName - The name of the branch. + * @param {PolicyInterfaces.PolicyConfiguration} configuration - The policy configuration to update. + * @param {string} project - Project ID or project name + * @param {number} configurationId - ID of the existing policy configuration to be updated. */ - getDeploymentBadge(projectId, releaseDefinitionId, environmentId, branchName) { + updatePolicyConfiguration(configuration, project, configurationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - projectId: projectId, - releaseDefinitionId: releaseDefinitionId, - environmentId: environmentId, - branchName: branchName + project: project, + configurationId: configurationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "1a60a35d-b8c9-45fb-bf67-da0829711147", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "dad91cbe-d183-45f8-9c6e-9c1164472121", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.replace(url, configuration, options); + let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, false); resolve(ret); } catch (err) { @@ -17869,31 +19458,25 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * Gets the present evaluation state of a policy. + * * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} baseReleaseId - * @param {number} top - * @param {string} artifactAlias + * @param {string} evaluationId - ID of the policy evaluation to be retrieved. */ - getReleaseChanges(project, releaseId, baseReleaseId, top, artifactAlias) { + getPolicyEvaluation(project, evaluationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId - }; - let queryValues = { - baseReleaseId: baseReleaseId, - '$top': top, - artifactAlias: artifactAlias, + evaluationId: evaluationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "8dcf9fe9-ca37-4113-8ee1-37928e98407c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "46aecb7a-5d2c-4647-897b-0209505a9fe4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Change, true); + let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyEvaluationRecord, false); resolve(ret); } catch (err) { @@ -17903,27 +19486,25 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * Requeue the policy evaluation. + * * @param {string} project - Project ID or project name - * @param {string} taskGroupId - * @param {string[]} propertyFilters + * @param {string} evaluationId - ID of the policy evaluation to be retrieved. */ - getDefinitionEnvironments(project, taskGroupId, propertyFilters) { + requeuePolicyEvaluation(project, evaluationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - taskGroupId: taskGroupId, - propertyFilters: propertyFilters && propertyFilters.join(","), + project: project, + evaluationId: evaluationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "12b5d21a-f54c-430e-a8c1-7515d196890e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "46aecb7a-5d2c-4647-897b-0209505a9fe4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.update(url, null, options); + let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyEvaluationRecord, false); resolve(ret); } catch (err) { @@ -17933,24 +19514,36 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Create a release definition + * Retrieves a list of all the policy evaluation statuses for a specific pull request. * - * @param {ReleaseInterfaces.ReleaseDefinition} releaseDefinition - release definition object to create. * @param {string} project - Project ID or project name + * @param {string} artifactId - A string which uniquely identifies the target of a policy evaluation. + * @param {boolean} includeNotApplicable - Some policies might determine that they do not apply to a specific pull request. Setting this parameter to true will return evaluation records even for policies which don't apply to this pull request. + * @param {number} top - The number of policy evaluation records to retrieve. + * @param {number} skip - The number of policy evaluation records to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. */ - createReleaseDefinition(releaseDefinition, project) { + getPolicyEvaluations(project, artifactId, includeNotApplicable, top, skip) { return __awaiter(this, void 0, void 0, function* () { + if (artifactId == null) { + throw new TypeError('artifactId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + artifactId: artifactId, + includeNotApplicable: includeNotApplicable, + '$top': top, + '$skip': skip, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "c23ddff5-229c-4d04-a80b-0fdce9f360c8", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, releaseDefinition, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinition, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyEvaluationRecord, true); resolve(ret); } catch (err) { @@ -17960,31 +19553,27 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Delete a release definition. + * Retrieve a specific revision of a given policy by ID. * * @param {string} project - Project ID or project name - * @param {number} definitionId - Id of the release definition. - * @param {string} comment - Comment for deleting a release definition. - * @param {boolean} forceDelete - 'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'. + * @param {number} configurationId - The policy configuration ID. + * @param {number} revisionId - The revision ID. */ - deleteReleaseDefinition(project, definitionId, comment, forceDelete) { + getPolicyConfigurationRevision(project, configurationId, revisionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - definitionId: definitionId - }; - let queryValues = { - comment: comment, - forceDelete: forceDelete, + configurationId: configurationId, + revisionId: revisionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "fe1e68a2-60d3-43cb-855b-85e41ae97c95", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, false); resolve(ret); } catch (err) { @@ -17994,29 +19583,31 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get a release definition. + * Retrieve all revisions for a given policy. * * @param {string} project - Project ID or project name - * @param {number} definitionId - Id of the release definition. - * @param {string[]} propertyFilters - A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definition will contain values for the specified property Ids (if they exist). If not set, properties will not be included. + * @param {number} configurationId - The policy configuration ID. + * @param {number} top - The number of revisions to retrieve. + * @param {number} skip - The number of revisions to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. */ - getReleaseDefinition(project, definitionId, propertyFilters) { + getPolicyConfigurationRevisions(project, configurationId, top, skip) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - definitionId: definitionId + configurationId: configurationId }; let queryValues = { - propertyFilters: propertyFilters && propertyFilters.join(","), + '$top': top, + '$skip': skip, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "fe1e68a2-60d3-43cb-855b-85e41ae97c95", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinition, false); + let ret = this.formatResponse(res.result, PolicyInterfaces.TypeInfo.PolicyConfiguration, true); resolve(ret); } catch (err) { @@ -18026,31 +19617,26 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get release definition of a given revision. + * Retrieve a specific policy type by ID. * * @param {string} project - Project ID or project name - * @param {number} definitionId - Id of the release definition. - * @param {number} revision - Revision number of the release definition. + * @param {string} typeId - The policy ID. */ - getReleaseDefinitionRevision(project, definitionId, revision) { + getPolicyType(project, typeId) { return __awaiter(this, void 0, void 0, function* () { - if (revision == null) { - throw new TypeError('revision can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - definitionId: definitionId - }; - let queryValues = { - revision: revision, + typeId: typeId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "44096322-2d3d-466a-bb30-d1b7de69f61f", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); } catch (err) { reject(err); @@ -18059,53 +19645,23 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get a list of release definitions. + * Retrieve all available policy types. * * @param {string} project - Project ID or project name - * @param {string} searchText - Get release definitions with names containing searchText. - * @param {ReleaseInterfaces.ReleaseDefinitionExpands} expand - The properties that should be expanded in the list of Release definitions. - * @param {string} artifactType - Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. - * @param {string} artifactSourceId - Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. - * @param {number} top - Number of release definitions to get. - * @param {string} continuationToken - Gets the release definitions after the continuation token provided. - * @param {ReleaseInterfaces.ReleaseDefinitionQueryOrder} queryOrder - Gets the results in the defined order. Default is 'IdAscending'. - * @param {string} path - Gets the release definitions under the specified path. - * @param {boolean} isExactNameMatch - 'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'. - * @param {string[]} tagFilter - A comma-delimited list of tags. Only release definitions with these tags will be returned. - * @param {string[]} propertyFilters - A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not. - * @param {string[]} definitionIdFilter - A comma-delimited list of release definitions to retrieve. - * @param {boolean} isDeleted - 'true' to get release definitions that has been deleted. Default is 'false' - * @param {boolean} searchTextContainsFolderName - 'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'. */ - getReleaseDefinitions(project, searchText, expand, artifactType, artifactSourceId, top, continuationToken, queryOrder, path, isExactNameMatch, tagFilter, propertyFilters, definitionIdFilter, isDeleted, searchTextContainsFolderName) { + getPolicyTypes(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; - let queryValues = { - searchText: searchText, - '$expand': expand, - artifactType: artifactType, - artifactSourceId: artifactSourceId, - '$top': top, - continuationToken: continuationToken, - queryOrder: queryOrder, - path: path, - isExactNameMatch: isExactNameMatch, - tagFilter: tagFilter && tagFilter.join(","), - propertyFilters: propertyFilters && propertyFilters.join(","), - definitionIdFilter: definitionIdFilter && definitionIdFilter.join(","), - isDeleted: isDeleted, - searchTextContainsFolderName: searchTextContainsFolderName, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "policy", "44096322-2d3d-466a-bb30-d1b7de69f61f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinition, true); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -18114,27 +19670,64 @@ class ReleaseApi extends basem.ClientApiBase { })); }); } +} +exports.PolicyApi = PolicyApi; +PolicyApi.RESOURCE_AREA_ID = "fb13a388-40dd-4a04-b530-013a739c72ef"; + + +/***/ }), + +/***/ 8101: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* +* --------------------------------------------------------- +* Copyright(C) Microsoft Corporation. All rights reserved. +* --------------------------------------------------------- +* +* --------------------------------------------------------- +* Generated file, DO NOT EDIT +* --------------------------------------------------------- +*/ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProfileApi = void 0; +const basem = __nccwpck_require__(273); +const ProfileInterfaces = __nccwpck_require__(879); +class ProfileApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Profile-api', options); + } /** - * Undelete a release definition. - * - * @param {ReleaseInterfaces.ReleaseDefinitionUndeleteParameter} releaseDefinitionUndeleteParameter - Object for undelete release definition. - * @param {string} project - Project ID or project name - * @param {number} definitionId - Id of the release definition to be undeleted - */ - undeleteReleaseDefinition(releaseDefinitionUndeleteParameter, project, definitionId) { + * @param {string} id + * @param {string} descriptor + */ + deleteProfileAttribute(id, descriptor) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - definitionId: definitionId + id: id + }; + let queryValues = { + descriptor: descriptor, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.2", "Profile", "1392b6ac-d511-492e-af5b-2263e5545a5d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, releaseDefinitionUndeleteParameter, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinition, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -18144,24 +19737,25 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Update a release definition. - * - * @param {ReleaseInterfaces.ReleaseDefinition} releaseDefinition - Release definition object to update. - * @param {string} project - Project ID or project name - */ - updateReleaseDefinition(releaseDefinition, project) { + * @param {string} id + * @param {string} descriptor + */ + getProfileAttribute(id, descriptor) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + id: id + }; + let queryValues = { + descriptor: descriptor, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.2", "Profile", "1392b6ac-d511-492e-af5b-2263e5545a5d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, releaseDefinition, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinition, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.ProfileAttribute, false); resolve(ret); } catch (err) { @@ -18171,53 +19765,33 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param {number} definitionEnvironmentId - * @param {string} createdBy - * @param {Date} minModifiedTime - * @param {Date} maxModifiedTime - * @param {ReleaseInterfaces.DeploymentStatus} deploymentStatus - * @param {ReleaseInterfaces.DeploymentOperationStatus} operationStatus - * @param {boolean} latestAttemptsOnly - * @param {ReleaseInterfaces.ReleaseQueryOrder} queryOrder - * @param {number} top - * @param {number} continuationToken - * @param {string} createdFor - * @param {Date} minStartedTime - * @param {Date} maxStartedTime - * @param {string} sourceBranch - */ - getDeployments(project, definitionId, definitionEnvironmentId, createdBy, minModifiedTime, maxModifiedTime, deploymentStatus, operationStatus, latestAttemptsOnly, queryOrder, top, continuationToken, createdFor, minStartedTime, maxStartedTime, sourceBranch) { + * @param {string} id + * @param {string} partition + * @param {string} modifiedSince + * @param {string} modifiedAfterRevision + * @param {boolean} withCoreAttributes + * @param {string} coreAttributes + */ + getProfileAttributes(id, partition, modifiedSince, modifiedAfterRevision, withCoreAttributes, coreAttributes) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + id: id }; let queryValues = { - definitionId: definitionId, - definitionEnvironmentId: definitionEnvironmentId, - createdBy: createdBy, - minModifiedTime: minModifiedTime, - maxModifiedTime: maxModifiedTime, - deploymentStatus: deploymentStatus, - operationStatus: operationStatus, - latestAttemptsOnly: latestAttemptsOnly, - queryOrder: queryOrder, - '$top': top, - continuationToken: continuationToken, - createdFor: createdFor, - minStartedTime: minStartedTime, - maxStartedTime: maxStartedTime, - sourceBranch: sourceBranch, + partition: partition, + modifiedSince: modifiedSince, + modifiedAfterRevision: modifiedAfterRevision, + withCoreAttributes: withCoreAttributes, + coreAttributes: coreAttributes, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "b005ef73-cddc-448e-9ba2-5193bf36b19f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.2", "Profile", "1392b6ac-d511-492e-af5b-2263e5545a5d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Deployment, true); + let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.ProfileAttribute, true); resolve(ret); } catch (err) { @@ -18227,22 +19801,26 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {ReleaseInterfaces.DeploymentQueryParameters} queryParameters - * @param {string} project - Project ID or project name - */ - getDeploymentsForMultipleEnvironments(queryParameters, project) { + * @param {any} container + * @param {string} id + * @param {string} descriptor + */ + setProfileAttribute(container, id, descriptor) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + id: id + }; + let queryValues = { + descriptor: descriptor, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "b005ef73-cddc-448e-9ba2-5193bf36b19f", routeValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.2", "Profile", "1392b6ac-d511-492e-af5b-2263e5545a5d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, queryParameters, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Deployment, true); + res = yield this.rest.replace(url, container, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -18252,31 +19830,22 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get a release environment. - * - * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {number} environmentId - Id of the release environment. - * @param {ReleaseInterfaces.ReleaseEnvironmentExpands} expand - A property that should be expanded in the environment. - */ - getReleaseEnvironment(project, releaseId, environmentId, expand) { + * @param {VSSInterfaces.VssJsonCollectionWrapperV[]>} attributesCollection + * @param {string} id + */ + setProfileAttributes(attributesCollection, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - releaseId: releaseId, - environmentId: environmentId - }; - let queryValues = { - '$expand': expand, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "Release", "a7e426b1-03dc-48af-9dfe-c98bac612dcb", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.2", "Profile", "1392b6ac-d511-492e-af5b-2263e5545a5d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseEnvironment, false); + res = yield this.rest.update(url, attributesCollection, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -18286,28 +19855,27 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Update the status of a release environment - * - * @param {ReleaseInterfaces.ReleaseEnvironmentUpdateMetadata} environmentUpdateData - Environment update meta data. - * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {number} environmentId - Id of release environment. - */ - updateReleaseEnvironment(environmentUpdateData, project, releaseId, environmentId) { + * @param {string} id + * @param {string} size + * @param {string} format + */ + getAvatar(id, size, format) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - releaseId: releaseId, - environmentId: environmentId + id: id + }; + let queryValues = { + size: size, + format: format, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.7", "Release", "a7e426b1-03dc-48af-9dfe-c98bac612dcb", routeValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "67436615-b382-462a-b659-5367a492fb3c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, environmentUpdateData, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseEnvironment, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Avatar, false); resolve(ret); } catch (err) { @@ -18317,24 +19885,30 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Creates a definition environment template - * - * @param {ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate} template - Definition environment template to create - * @param {string} project - Project ID or project name - */ - createDefinitionEnvironmentTemplate(template, project) { + * @param {any} container + * @param {string} id + * @param {string} size + * @param {string} format + * @param {string} displayName + */ + getAvatarPreview(container, id, size, format, displayName) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + id: id + }; + let queryValues = { + size: size, + format: format, + displayName: displayName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "6b03b696-824e-4479-8eb2-6644a51aba89", routeValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "67436615-b382-462a-b659-5367a492fb3c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, template, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionEnvironmentTemplate, false); + res = yield this.rest.create(url, container, options); + let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Avatar, false); resolve(ret); } catch (err) { @@ -18344,25 +19918,16 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Delete a definition environment template - * - * @param {string} project - Project ID or project name - * @param {string} templateId - Id of the definition environment template - */ - deleteDefinitionEnvironmentTemplate(project, templateId) { + * @param {string} id + */ + resetAvatar(id) { return __awaiter(this, void 0, void 0, function* () { - if (templateId == null) { - throw new TypeError('templateId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - templateId: templateId, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "6b03b696-824e-4479-8eb2-6644a51aba89", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "67436615-b382-462a-b659-5367a492fb3c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -18377,30 +19942,22 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets a definition environment template - * - * @param {string} project - Project ID or project name - * @param {string} templateId - Id of the definition environment template - */ - getDefinitionEnvironmentTemplate(project, templateId) { + * @param {any} container + * @param {string} id + */ + setAvatar(container, id) { return __awaiter(this, void 0, void 0, function* () { - if (templateId == null) { - throw new TypeError('templateId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - templateId: templateId, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "6b03b696-824e-4479-8eb2-6644a51aba89", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "67436615-b382-462a-b659-5367a492fb3c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionEnvironmentTemplate, false); + res = yield this.rest.replace(url, container, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -18410,27 +19967,24 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets a list of definition environment templates - * - * @param {string} project - Project ID or project name - * @param {boolean} isDeleted - 'true' to get definition environment templates that have been deleted. Default is 'false' - */ - listDefinitionEnvironmentTemplates(project, isDeleted) { + * Lookup up country/region based on provided IPv4, null if using the remote IPv4 address. + * + * @param {string} ipaddress - IPv4 address to be used for reverse lookup, null if using RemoteIPAddress in request context + */ + getGeoRegion(ipaddress) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project - }; + let routeValues = {}; let queryValues = { - isDeleted: isDeleted, + ipaddress: ipaddress, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "6b03b696-824e-4479-8eb2-6644a51aba89", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "3bcda9c0-3078-48a5-a1e0-83bd05931ad0", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionEnvironmentTemplate, true); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -18440,30 +19994,25 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Undelete a release definition environment template. - * - * @param {string} project - Project ID or project name - * @param {string} templateId - Id of the definition environment template to be undeleted - */ - undeleteReleaseDefinitionEnvironmentTemplate(project, templateId) { + * Create profile + * + * @param {ProfileInterfaces.CreateProfileContext} createProfileContext - Context for profile creation + * @param {boolean} autoCreate - Create profile automatically + */ + createProfile(createProfileContext, autoCreate) { return __awaiter(this, void 0, void 0, function* () { - if (templateId == null) { - throw new TypeError('templateId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project - }; + let routeValues = {}; let queryValues = { - templateId: templateId, + autoCreate: autoCreate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.4", "Release", "6b03b696-824e-4479-8eb2-6644a51aba89", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.3", "Profile", "f83735dc-483f-4238-a291-d45f6080a9af", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, null, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionEnvironmentTemplate, false); + res = yield this.rest.create(url, createProfileContext, options); + let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Profile, false); resolve(ret); } catch (err) { @@ -18473,28 +20022,33 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {ReleaseInterfaces.FavoriteItem[]} favoriteItems - * @param {string} project - Project ID or project name - * @param {string} scope - * @param {string} identityId - */ - createFavorites(favoriteItems, project, scope, identityId) { + * @param {string} id + * @param {boolean} details + * @param {boolean} withAttributes + * @param {string} partition + * @param {string} coreAttributes + * @param {boolean} forceRefresh + */ + getProfile(id, details, withAttributes, partition, coreAttributes, forceRefresh) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - scope: scope + id: id }; let queryValues = { - identityId: identityId, + details: details, + withAttributes: withAttributes, + partition: partition, + coreAttributes: coreAttributes, + forceRefresh: forceRefresh, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "938f7222-9acb-48fe-b8a3-4eda04597171", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.3", "Profile", "f83735dc-483f-4238-a291-d45f6080a9af", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, favoriteItems, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Profile, false); resolve(ret); } catch (err) { @@ -18504,28 +20058,23 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {string} scope - * @param {string} identityId - * @param {string} favoriteItemIds - */ - deleteFavorites(project, scope, identityId, favoriteItemIds) { + * Update profile + * + * @param {ProfileInterfaces.Profile} profile - Update profile + * @param {string} id - Profile ID + */ + updateProfile(profile, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - scope: scope - }; - let queryValues = { - identityId: identityId, - favoriteItemIds: favoriteItemIds, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "938f7222-9acb-48fe-b8a3-4eda04597171", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.3", "Profile", "f83735dc-483f-4238-a291-d45f6080a9af", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.update(url, profile, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -18536,27 +20085,18 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {string} scope - * @param {string} identityId - */ - getFavorites(project, scope, identityId) { + */ + getRegions() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - scope: scope - }; - let queryValues = { - identityId: identityId, - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "938f7222-9acb-48fe-b8a3-4eda04597171", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "92d8d1c9-26b8-4774-a929-d640a73da524", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -18566,17 +20106,13 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {string} flightName - */ - getFlightAssignments(flightName) { + */ + getSupportedLcids() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; - let queryValues = { - flightName: flightName, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "409d301f-3046-46f3-beb9-4357fbce0a8c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "d5bd1aa6-c269-4bcd-ad32-75fa17475584", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -18591,26 +20127,22 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Creates a new folder. - * - * @param {ReleaseInterfaces.Folder} folder - folder. - * @param {string} project - Project ID or project name - * @param {string} path - Path of the folder. - */ - createFolder(folder, project, path) { + * @param {boolean} includeAvatar + */ + getUserDefaults(includeAvatar) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - path: path + let routeValues = {}; + let queryValues = { + includeAvatar: includeAvatar, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "f7ddf76d-ce0c-4d68-94ff-becaec5d9dea", routeValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "b583a356-1da7-4237-9f4c-1deb2edbc7e8", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, folder, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Folder, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Profile, false); resolve(ret); } catch (err) { @@ -18620,25 +20152,21 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Deletes a definition folder for given folder name and path and all it's existing definitions. - * - * @param {string} project - Project ID or project name - * @param {string} path - Path of the folder to delete. - */ - deleteFolder(project, path) { + * @param {string} id + */ + refreshUserDefaults(id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - path: path + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "f7ddf76d-ce0c-4d68-94ff-becaec5d9dea", routeValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "Profile", "b583a356-1da7-4237-9f4c-1deb2edbc7e8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.replace(url, options); + let ret = this.formatResponse(res.result, ProfileInterfaces.TypeInfo.Profile, false); resolve(ret); } catch (err) { @@ -18647,30 +20175,59 @@ class ReleaseApi extends basem.ClientApiBase { })); }); } +} +exports.ProfileApi = ProfileApi; + + +/***/ }), + +/***/ 1682: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProjectAnalysisApi = void 0; +const basem = __nccwpck_require__(273); +const ProjectAnalysisInterfaces = __nccwpck_require__(4323); +class ProjectAnalysisApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-ProjectAnalysis-api', options); + } /** - * Gets folders. - * * @param {string} project - Project ID or project name - * @param {string} path - Path of the folder. - * @param {ReleaseInterfaces.FolderPathQueryOrder} queryOrder - Gets the results in the defined order. Default is 'None'. */ - getFolders(project, path, queryOrder) { + getProjectLanguageAnalytics(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - path: path - }; - let queryValues = { - queryOrder: queryOrder, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "f7ddf76d-ce0c-4d68-94ff-becaec5d9dea", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "projectanalysis", "5b02a779-1867-433f-90b7-d23ed5e33e57", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Folder, true); + let ret = this.formatResponse(res.result, ProjectAnalysisInterfaces.TypeInfo.ProjectLanguageAnalytics, false); resolve(ret); } catch (err) { @@ -18680,26 +20237,33 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Updates an existing folder at given existing path. - * - * @param {ReleaseInterfaces.Folder} folder - folder. * @param {string} project - Project ID or project name - * @param {string} path - Path of the folder to update. + * @param {Date} fromDate + * @param {ProjectAnalysisInterfaces.AggregationType} aggregationType */ - updateFolder(folder, project, path) { + getProjectActivityMetrics(project, fromDate, aggregationType) { return __awaiter(this, void 0, void 0, function* () { + if (fromDate == null) { + throw new TypeError('fromDate can not be null or undefined'); + } + if (aggregationType == null) { + throw new TypeError('aggregationType can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - path: path + project: project + }; + let queryValues = { + fromDate: fromDate, + aggregationType: aggregationType, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "f7ddf76d-ce0c-4d68-94ff-becaec5d9dea", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "projectanalysis", "e40ae584-9ea6-4f06-a7c7-6284651b466b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, folder, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Folder, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ProjectAnalysisInterfaces.TypeInfo.ProjectActivityMetrics, false); resolve(ret); } catch (err) { @@ -18709,26 +20273,45 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Updates the gate for a deployment. + * Retrieves git activity metrics for repositories matching a specified criteria. * - * @param {ReleaseInterfaces.GateUpdateMetadata} gateUpdateMetadata - Metadata to patch the Release Gates. * @param {string} project - Project ID or project name - * @param {number} gateStepId - Gate step Id. + * @param {Date} fromDate - Date from which, the trends are to be fetched. + * @param {ProjectAnalysisInterfaces.AggregationType} aggregationType - Bucket size on which, trends are to be aggregated. + * @param {number} skip - The number of repositories to ignore. + * @param {number} top - The number of repositories for which activity metrics are to be retrieved. */ - updateGates(gateUpdateMetadata, project, gateStepId) { + getGitRepositoriesActivityMetrics(project, fromDate, aggregationType, skip, top) { return __awaiter(this, void 0, void 0, function* () { + if (fromDate == null) { + throw new TypeError('fromDate can not be null or undefined'); + } + if (aggregationType == null) { + throw new TypeError('aggregationType can not be null or undefined'); + } + if (skip == null) { + throw new TypeError('skip can not be null or undefined'); + } + if (top == null) { + throw new TypeError('top can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - gateStepId: gateStepId + project: project + }; + let queryValues = { + fromDate: fromDate, + aggregationType: aggregationType, + '$skip': skip, + '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "2666a539-2001-4f80-bcc7-0379956749d4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "projectanalysis", "df7fbbca-630a-40e3-8aa3-7a3faf66947e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, gateUpdateMetadata, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseGates, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ProjectAnalysisInterfaces.TypeInfo.RepositoryActivityMetrics, true); resolve(ret); } catch (err) { @@ -18739,22 +20322,34 @@ class ReleaseApi extends basem.ClientApiBase { } /** * @param {string} project - Project ID or project name - * @param {number} releaseId + * @param {string} repositoryId + * @param {Date} fromDate + * @param {ProjectAnalysisInterfaces.AggregationType} aggregationType */ - getReleaseHistory(project, releaseId) { + getRepositoryActivityMetrics(project, repositoryId, fromDate, aggregationType) { return __awaiter(this, void 0, void 0, function* () { + if (fromDate == null) { + throw new TypeError('fromDate can not be null or undefined'); + } + if (aggregationType == null) { + throw new TypeError('aggregationType can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId + repositoryId: repositoryId + }; + let queryValues = { + fromDate: fromDate, + aggregationType: aggregationType, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "23f461c8-629a-4144-a076-3054fa5f268a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "projectanalysis", "df7fbbca-630a-40e3-8aa3-7a3faf66947e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseRevision, true); + let ret = this.formatResponse(res.result, ProjectAnalysisInterfaces.TypeInfo.RepositoryActivityMetrics, false); resolve(ret); } catch (err) { @@ -18763,23 +20358,64 @@ class ReleaseApi extends basem.ClientApiBase { })); }); } +} +exports.ProjectAnalysisApi = ProjectAnalysisApi; +ProjectAnalysisApi.RESOURCE_AREA_ID = "7658fa33-b1bf-4580-990f-fac5896773d3"; + + +/***/ }), + +/***/ 3075: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReleaseApi = void 0; +const basem = __nccwpck_require__(273); +const ReleaseInterfaces = __nccwpck_require__(7421); +class ReleaseApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Release-api', options); + } /** - * @param {FormInputInterfaces.InputValuesQuery} query + * Returns the artifact details that automation agent requires + * * @param {string} project - Project ID or project name + * @param {number} releaseId */ - getInputValues(query, project) { + getAgentArtifactDefinitions(project, releaseId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + releaseId: releaseId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "71dd499b-317d-45ea-9134-140ea1932b5e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "f2571c27-bf50-4938-b396-32d109ddef26", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, query, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.AgentArtifactDefinition, true); resolve(ret); } catch (err) { @@ -18789,27 +20425,41 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * Get a list of approvals + * * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} sourceId - */ - getIssues(project, buildId, sourceId) { - return __awaiter(this, void 0, void 0, function* () { + * @param {string} assignedToFilter - Approvals assigned to this user. + * @param {ReleaseInterfaces.ApprovalStatus} statusFilter - Approvals with this status. Default is 'pending'. + * @param {number[]} releaseIdsFilter - Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4. + * @param {ReleaseInterfaces.ApprovalType} typeFilter - Approval with this type. + * @param {number} top - Number of approvals to get. Default is 50. + * @param {number} continuationToken - Gets the approvals after the continuation token provided. + * @param {ReleaseInterfaces.ReleaseQueryOrder} queryOrder - Gets the results in the defined order of created approvals. Default is 'descending'. + * @param {boolean} includeMyGroupApprovals - 'true' to include my group approvals. Default is 'false'. + */ + getApprovals(project, assignedToFilter, statusFilter, releaseIdsFilter, typeFilter, top, continuationToken, queryOrder, includeMyGroupApprovals) { + return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - buildId: buildId + project: project }; let queryValues = { - sourceId: sourceId, + assignedToFilter: assignedToFilter, + statusFilter: statusFilter, + releaseIdsFilter: releaseIdsFilter && releaseIdsFilter.join(","), + typeFilter: typeFilter, + top: top, + continuationToken: continuationToken, + queryOrder: queryOrder, + includeMyGroupApprovals: includeMyGroupApprovals, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "cd42261a-f5c6-41c8-9259-f078989b9f25", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Release", "b47c6458-e73b-47cb-a770-4df1e8813a91", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.AutoTriggerIssue, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseApproval, true); resolve(ret); } catch (err) { @@ -18819,30 +20469,26 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets gate logs + * Get approval history. * * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {number} environmentId - Id of release environment. - * @param {number} gateId - Id of the gate. - * @param {number} taskId - ReleaseTask Id for the log. + * @param {number} approvalStepId - Id of the approval. */ - getGateLog(project, releaseId, environmentId, gateId, taskId) { + getApprovalHistory(project, approvalStepId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId, - environmentId: environmentId, - gateId: gateId, - taskId: taskId + approvalStepId: approvalStepId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "dec7ca5a-7f7f-4797-8bf1-8efc0dc93b28", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Release", "250c7158-852e-4130-a00f-a0cce9b72d05", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseApproval, false); + resolve(ret); } catch (err) { reject(err); @@ -18851,24 +20497,30 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get logs for a release Id. + * Get an approval. * * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. + * @param {number} approvalId - Id of the approval. + * @param {boolean} includeHistory - 'true' to include history of the approval. Default is 'false'. */ - getLogs(project, releaseId) { + getApproval(project, approvalId, includeHistory) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId + approvalId: approvalId + }; + let queryValues = { + includeHistory: includeHistory, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "c37fbab5-214b-48e4-a55b-cb6b4f6e4038", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Release", "9328e074-59fb-465a-89d9-b09c82ee5109", routeValues, queryValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseApproval, false); + resolve(ret); } catch (err) { reject(err); @@ -18877,32 +20529,27 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets logs + * Update status of an approval * + * @param {ReleaseInterfaces.ReleaseApproval} approval - ReleaseApproval object having status, approver and comments. * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {number} environmentId - Id of release environment. - * @param {number} taskId - ReleaseTask Id for the log. - * @param {number} attemptId - Id of the attempt. + * @param {number} approvalId - Id of the approval. */ - getLog(project, releaseId, environmentId, taskId, attemptId) { + updateReleaseApproval(approval, project, approvalId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId, - environmentId: environmentId, - taskId: taskId - }; - let queryValues = { - attemptId: attemptId, + approvalId: approvalId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "e71ba1ed-c0a4-4a28-a61f-2dd5f68cf3fd", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Release", "9328e074-59fb-465a-89d9-b09c82ee5109", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, approval, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseApproval, false); + resolve(ret); } catch (err) { reject(err); @@ -18911,38 +20558,23 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets the task log of a release as a plain text file. - * + * @param {ReleaseInterfaces.ReleaseApproval[]} approvals * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {number} environmentId - Id of release environment. - * @param {number} attemptId - * @param {string} timelineId - * @param {number} taskId - ReleaseTask Id for the log. - * @param {number} startLine - Starting line number for logs - * @param {number} endLine - Ending line number for logs */ - getTaskLog2(project, releaseId, environmentId, attemptId, timelineId, taskId, startLine, endLine) { + updateReleaseApprovals(approvals, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - releaseId: releaseId, - environmentId: environmentId, - attemptId: attemptId, - timelineId: timelineId, - taskId: taskId - }; - let queryValues = { - startLine: startLine, - endLine: endLine, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "2577e6c3-6999-4400-bc69-fe1d837755fe", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Release", "c957584a-82aa-4131-8222-6d47f78bfa7a", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, approvals, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseApproval, true); + resolve(ret); } catch (err) { reject(err); @@ -18951,35 +20583,35 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets the task log of a release as a plain text file. + * Get a task attachment. * * @param {string} project - Project ID or project name * @param {number} releaseId - Id of the release. - * @param {number} environmentId - Id of release environment. - * @param {number} releaseDeployPhaseId - Release deploy phase Id. - * @param {number} taskId - ReleaseTask Id for the log. - * @param {number} startLine - Starting line number for logs - * @param {number} endLine - Ending line number for logs + * @param {number} environmentId - Id of the release environment. + * @param {number} attemptId - Attempt number of deployment. + * @param {string} timelineId - Timeline Id of the task. + * @param {string} recordId - Record Id of attachment. + * @param {string} type - Type of the attachment. + * @param {string} name - Name of the attachment. */ - getTaskLog(project, releaseId, environmentId, releaseDeployPhaseId, taskId, startLine, endLine) { + getTaskAttachmentContent(project, releaseId, environmentId, attemptId, timelineId, recordId, type, name) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, releaseId: releaseId, environmentId: environmentId, - releaseDeployPhaseId: releaseDeployPhaseId, - taskId: taskId - }; - let queryValues = { - startLine: startLine, - endLine: endLine, + attemptId: attemptId, + timelineId: timelineId, + recordId: recordId, + type: type, + name: name }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "17c91af7-09fd-4256-bff1-c24ee4f73bc0", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "c4071f6d-3697-46ca-858e-8b10ff09e52f", routeValues); let url = verData.requestUrl; let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { @@ -18989,28 +20621,38 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get manual intervention for a given release and manual intervention id. + * Get a release task attachment. * * @param {string} project - Project ID or project name * @param {number} releaseId - Id of the release. - * @param {number} manualInterventionId - Id of the manual intervention. + * @param {number} environmentId - Id of the release environment. + * @param {number} attemptId - Attempt number of deployment. + * @param {string} planId - Plan Id of the deploy phase. + * @param {string} timelineId - Timeline Id of the task. + * @param {string} recordId - Record Id of attachment. + * @param {string} type - Type of the attachment. + * @param {string} name - Name of the attachment. */ - getManualIntervention(project, releaseId, manualInterventionId) { + getReleaseTaskAttachmentContent(project, releaseId, environmentId, attemptId, planId, timelineId, recordId, type, name) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, releaseId: releaseId, - manualInterventionId: manualInterventionId + environmentId: environmentId, + attemptId: attemptId, + planId: planId, + timelineId: timelineId, + recordId: recordId, + type: type, + name: name }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "616c46e4-f370-4456-adaa-fbaf79c7b79e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "60b86efb-7b8c-4853-8f9f-aa142b77b479", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ManualIntervention, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -19019,25 +20661,33 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * List all manual interventions for a given release. + * Get the task attachments. * * @param {string} project - Project ID or project name * @param {number} releaseId - Id of the release. + * @param {number} environmentId - Id of the release environment. + * @param {number} attemptId - Attempt number of deployment. + * @param {string} timelineId - Timeline Id of the task. + * @param {string} type - Type of the attachment. */ - getManualInterventions(project, releaseId) { + getTaskAttachments(project, releaseId, environmentId, attemptId, timelineId, type) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId + releaseId: releaseId, + environmentId: environmentId, + attemptId: attemptId, + timelineId: timelineId, + type: type }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "616c46e4-f370-4456-adaa-fbaf79c7b79e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "214111ee-2415-4df2-8ed2-74417f7d61f9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ManualIntervention, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseTaskAttachment, true); resolve(ret); } catch (err) { @@ -19047,28 +20697,33 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Update manual intervention. + * Get the release task attachments. * - * @param {ReleaseInterfaces.ManualInterventionUpdateMetadata} manualInterventionUpdateMetadata - Meta data to update manual intervention. * @param {string} project - Project ID or project name * @param {number} releaseId - Id of the release. - * @param {number} manualInterventionId - Id of the manual intervention. + * @param {number} environmentId - Id of the release environment. + * @param {number} attemptId - Attempt number of deployment. + * @param {string} planId - Plan Id of the deploy phase. + * @param {string} type - Type of the attachment. */ - updateManualIntervention(manualInterventionUpdateMetadata, project, releaseId, manualInterventionId) { + getReleaseTaskAttachments(project, releaseId, environmentId, attemptId, planId, type) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, releaseId: releaseId, - manualInterventionId: manualInterventionId + environmentId: environmentId, + attemptId: attemptId, + planId: planId, + type: type }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "616c46e4-f370-4456-adaa-fbaf79c7b79e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "a4d06688-0dfa-4895-82a5-f43ec9452306", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, manualInterventionUpdateMetadata, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ManualIntervention, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseTaskAttachment, true); resolve(ret); } catch (err) { @@ -19078,25 +20733,38 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * @param {string} artifactType + * @param {string} sourceId + * @param {string} artifactVersionId * @param {string} project - Project ID or project name - * @param {Date} minMetricsTime */ - getMetrics(project, minMetricsTime) { + getAutoTriggerIssues(artifactType, sourceId, artifactVersionId, project) { return __awaiter(this, void 0, void 0, function* () { + if (artifactType == null) { + throw new TypeError('artifactType can not be null or undefined'); + } + if (sourceId == null) { + throw new TypeError('sourceId can not be null or undefined'); + } + if (artifactVersionId == null) { + throw new TypeError('artifactVersionId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; let queryValues = { - minMetricsTime: minMetricsTime, + artifactType: artifactType, + sourceId: sourceId, + artifactVersionId: artifactVersionId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "cd1502bb-3c73-4e11-80a6-d11308dceae5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "c1a68497-69da-40fb-9423-cab19cfeeca9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.AutoTriggerIssue, true); resolve(ret); } catch (err) { @@ -19106,15 +20774,24 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets Org pipeline release settings + * Gets a badge that indicates the status of the most recent deployment for an environment. * + * @param {string} projectId - The ID of the Project. + * @param {number} releaseDefinitionId - The ID of the Release Definition. + * @param {number} environmentId - The ID of the Environment. + * @param {string} branchName - The name of the branch. */ - getOrgPipelineReleaseSettings() { + getDeploymentBadge(projectId, releaseDefinitionId, environmentId, branchName) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + projectId: projectId, + releaseDefinitionId: releaseDefinitionId, + environmentId: environmentId, + branchName: branchName + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "d156c759-ca4e-492b-90d4-db03971796ea", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "1a60a35d-b8c9-45fb-bf67-da0829711147", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -19129,21 +20806,31 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Updates Org pipeline release settings - * - * @param {ReleaseInterfaces.OrgPipelineReleaseSettingsUpdateParameters} newSettings + * @param {string} project - Project ID or project name + * @param {number} releaseId + * @param {number} baseReleaseId + * @param {number} top + * @param {string} artifactAlias */ - updateOrgPipelineReleaseSettings(newSettings) { + getReleaseChanges(project, releaseId, baseReleaseId, top, artifactAlias) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + releaseId: releaseId + }; + let queryValues = { + baseReleaseId: baseReleaseId, + '$top': top, + artifactAlias: artifactAlias, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "d156c759-ca4e-492b-90d4-db03971796ea", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "8dcf9fe9-ca37-4113-8ee1-37928e98407c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, newSettings, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Change, true); resolve(ret); } catch (err) { @@ -19153,23 +20840,27 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets pipeline release settings - * * @param {string} project - Project ID or project name + * @param {string} taskGroupId + * @param {string[]} propertyFilters */ - getPipelineReleaseSettings(project) { + getDefinitionEnvironments(project, taskGroupId, propertyFilters) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + taskGroupId: taskGroupId, + propertyFilters: propertyFilters && propertyFilters.join(","), + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "e816b9f4-f9fe-46ba-bdcc-a9af6abf3144", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "12b5d21a-f54c-430e-a8c1-7515d196890e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -19179,24 +20870,24 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Updates pipeline release settings + * Create a release definition * - * @param {ReleaseInterfaces.ProjectPipelineReleaseSettingsUpdateParameters} newSettings + * @param {ReleaseInterfaces.ReleaseDefinition} releaseDefinition - release definition object to create. * @param {string} project - Project ID or project name */ - updatePipelineReleaseSettings(newSettings, project) { + createReleaseDefinition(releaseDefinition, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "e816b9f4-f9fe-46ba-bdcc-a9af6abf3144", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, newSettings, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, releaseDefinition, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinition, false); resolve(ret); } catch (err) { @@ -19206,30 +20897,31 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {string} artifactType - * @param {string} artifactSourceId + * Delete a release definition. + * + * @param {string} project - Project ID or project name + * @param {number} definitionId - Id of the release definition. + * @param {string} comment - Comment for deleting a release definition. + * @param {boolean} forceDelete - 'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'. */ - getReleaseProjects(artifactType, artifactSourceId) { + deleteReleaseDefinition(project, definitionId, comment, forceDelete) { return __awaiter(this, void 0, void 0, function* () { - if (artifactType == null) { - throw new TypeError('artifactType can not be null or undefined'); - } - if (artifactSourceId == null) { - throw new TypeError('artifactSourceId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + definitionId: definitionId + }; let queryValues = { - artifactType: artifactType, - artifactSourceId: artifactSourceId, + comment: comment, + forceDelete: forceDelete, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "917ace4a-79d1-45a7-987c-7be4db4268fa", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -19239,67 +20931,31 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get a list of releases + * Get a release definition. * * @param {string} project - Project ID or project name - * @param {number} definitionId - Releases from this release definition Id. - * @param {number} definitionEnvironmentId - * @param {string} searchText - Releases with names containing searchText. - * @param {string} createdBy - Releases created by this user. - * @param {ReleaseInterfaces.ReleaseStatus} statusFilter - Releases that have this status. - * @param {number} environmentStatusFilter - * @param {Date} minCreatedTime - Releases that were created after this time. - * @param {Date} maxCreatedTime - Releases that were created before this time. - * @param {ReleaseInterfaces.ReleaseQueryOrder} queryOrder - Gets the results in the defined order of created date for releases. Default is descending. - * @param {number} top - Number of releases to get. Default is 50. - * @param {number} continuationToken - Gets the releases after the continuation token provided. - * @param {ReleaseInterfaces.ReleaseExpands} expand - The property that should be expanded in the list of releases. - * @param {string} artifactTypeId - Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. - * @param {string} sourceId - Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. - * @param {string} artifactVersionId - Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId. - * @param {string} sourceBranchFilter - Releases with given sourceBranchFilter will be returned. - * @param {boolean} isDeleted - Gets the soft deleted releases, if true. - * @param {string[]} tagFilter - A comma-delimited list of tags. Only releases with these tags will be returned. - * @param {string[]} propertyFilters - A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not. - * @param {number[]} releaseIdFilter - A comma-delimited list of releases Ids. Only releases with these Ids will be returned. - * @param {string} path - Releases under this folder path will be returned + * @param {number} definitionId - Id of the release definition. + * @param {string[]} propertyFilters - A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definition will contain values for the specified property Ids (if they exist). If not set, properties will not be included. + * @param {boolean} includeDisabled - Boolean flag to include disabled definitions. */ - getReleases(project, definitionId, definitionEnvironmentId, searchText, createdBy, statusFilter, environmentStatusFilter, minCreatedTime, maxCreatedTime, queryOrder, top, continuationToken, expand, artifactTypeId, sourceId, artifactVersionId, sourceBranchFilter, isDeleted, tagFilter, propertyFilters, releaseIdFilter, path) { + getReleaseDefinition(project, definitionId, propertyFilters, includeDisabled) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + definitionId: definitionId }; let queryValues = { - definitionId: definitionId, - definitionEnvironmentId: definitionEnvironmentId, - searchText: searchText, - createdBy: createdBy, - statusFilter: statusFilter, - environmentStatusFilter: environmentStatusFilter, - minCreatedTime: minCreatedTime, - maxCreatedTime: maxCreatedTime, - queryOrder: queryOrder, - '$top': top, - continuationToken: continuationToken, - '$expand': expand, - artifactTypeId: artifactTypeId, - sourceId: sourceId, - artifactVersionId: artifactVersionId, - sourceBranchFilter: sourceBranchFilter, - isDeleted: isDeleted, - tagFilter: tagFilter && tagFilter.join(","), propertyFilters: propertyFilters && propertyFilters.join(","), - releaseIdFilter: releaseIdFilter && releaseIdFilter.join(","), - path: path, + includeDisabled: includeDisabled, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.8", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Release, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinition, false); resolve(ret); } catch (err) { @@ -19309,25 +20965,31 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Create a release. + * Get release definition of a given revision. * - * @param {ReleaseInterfaces.ReleaseStartMetadata} releaseStartMetadata - Metadata to create a release. * @param {string} project - Project ID or project name + * @param {number} definitionId - Id of the release definition. + * @param {number} revision - Revision number of the release definition. */ - createRelease(releaseStartMetadata, project) { + getReleaseDefinitionRevision(project, definitionId, revision) { return __awaiter(this, void 0, void 0, function* () { + if (revision == null) { + throw new TypeError('revision can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + definitionId: definitionId + }; + let queryValues = { + revision: revision, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.8", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, releaseStartMetadata, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Release, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -19336,29 +20998,53 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Soft delete a release + * Get a list of release definitions. * * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {string} comment - Comment for deleting a release. + * @param {string} searchText - Get release definitions with names containing searchText. + * @param {ReleaseInterfaces.ReleaseDefinitionExpands} expand - The properties that should be expanded in the list of Release definitions. + * @param {string} artifactType - Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. + * @param {string} artifactSourceId - Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. + * @param {number} top - Number of release definitions to get. + * @param {string} continuationToken - Gets the release definitions after the continuation token provided. + * @param {ReleaseInterfaces.ReleaseDefinitionQueryOrder} queryOrder - Gets the results in the defined order. Default is 'IdAscending'. + * @param {string} path - Gets the release definitions under the specified path. + * @param {boolean} isExactNameMatch - 'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'. + * @param {string[]} tagFilter - A comma-delimited list of tags. Only release definitions with these tags will be returned. + * @param {string[]} propertyFilters - A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not. + * @param {string[]} definitionIdFilter - A comma-delimited list of release definitions to retrieve. + * @param {boolean} isDeleted - 'true' to get release definitions that has been deleted. Default is 'false' + * @param {boolean} searchTextContainsFolderName - 'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'. */ - deleteRelease(project, releaseId, comment) { + getReleaseDefinitions(project, searchText, expand, artifactType, artifactSourceId, top, continuationToken, queryOrder, path, isExactNameMatch, tagFilter, propertyFilters, definitionIdFilter, isDeleted, searchTextContainsFolderName) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - releaseId: releaseId + project: project }; let queryValues = { - comment: comment, + searchText: searchText, + '$expand': expand, + artifactType: artifactType, + artifactSourceId: artifactSourceId, + '$top': top, + continuationToken: continuationToken, + queryOrder: queryOrder, + path: path, + isExactNameMatch: isExactNameMatch, + tagFilter: tagFilter && tagFilter.join(","), + propertyFilters: propertyFilters && propertyFilters.join(","), + definitionIdFilter: definitionIdFilter && definitionIdFilter.join(","), + isDeleted: isDeleted, + searchTextContainsFolderName: searchTextContainsFolderName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.8", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinition, true); resolve(ret); } catch (err) { @@ -19368,35 +21054,26 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get a Release + * Undelete a release definition. * + * @param {ReleaseInterfaces.ReleaseDefinitionUndeleteParameter} releaseDefinitionUndeleteParameter - Object for undelete release definition. * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {ReleaseInterfaces.ApprovalFilters} approvalFilters - A filter which would allow fetching approval steps selectively based on whether it is automated, or manual. This would also decide whether we should fetch pre and post approval snapshots. Assumes All by default - * @param {string[]} propertyFilters - A comma-delimited list of extended properties to be retrieved. If set, the returned Release will contain values for the specified property Ids (if they exist). If not set, properties will not be included. - * @param {ReleaseInterfaces.SingleReleaseExpands} expand - A property that should be expanded in the release. - * @param {number} topGateRecords - Number of release gate records to get. Default is 5. + * @param {number} definitionId - Id of the release definition to be undeleted */ - getRelease(project, releaseId, approvalFilters, propertyFilters, expand, topGateRecords) { + undeleteReleaseDefinition(releaseDefinitionUndeleteParameter, project, definitionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId - }; - let queryValues = { - approvalFilters: approvalFilters, - propertyFilters: propertyFilters && propertyFilters.join(","), - '$expand': expand, - '$topGateRecords': topGateRecords, + definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.8", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Release, false); + res = yield this.rest.update(url, releaseDefinitionUndeleteParameter, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinition, false); resolve(ret); } catch (err) { @@ -19406,39 +21083,28 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get release summary of a given definition Id. + * Update a release definition. * + * @param {ReleaseInterfaces.ReleaseDefinition} releaseDefinition - Release definition object to update. * @param {string} project - Project ID or project name - * @param {number} definitionId - Id of the definition to get release summary. - * @param {number} releaseCount - Count of releases to be included in summary. - * @param {boolean} includeArtifact - Include artifact details.Default is 'false'. - * @param {number[]} definitionEnvironmentIdsFilter + * @param {boolean} skipTasksValidation - Skip task validation boolean flag */ - getReleaseDefinitionSummary(project, definitionId, releaseCount, includeArtifact, definitionEnvironmentIdsFilter) { + updateReleaseDefinition(releaseDefinition, project, skipTasksValidation) { return __awaiter(this, void 0, void 0, function* () { - if (definitionId == null) { - throw new TypeError('definitionId can not be null or undefined'); - } - if (releaseCount == null) { - throw new TypeError('releaseCount can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; let queryValues = { - definitionId: definitionId, - releaseCount: releaseCount, - includeArtifact: includeArtifact, - definitionEnvironmentIdsFilter: definitionEnvironmentIdsFilter && definitionEnvironmentIdsFilter.join(","), + skipTasksValidation: skipTasksValidation, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.8", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "d8f96f24-8ea7-4cb6-baab-2df8fc515665", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionSummary, false); + res = yield this.rest.replace(url, releaseDefinition, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinition, false); resolve(ret); } catch (err) { @@ -19448,65 +21114,80 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get release for a given revision number. + * Get a list of deployments * * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release. - * @param {number} definitionSnapshotRevision - Definition snapshot revision number. + * @param {number} definitionId - List the deployments for a given definition id. + * @param {number} definitionEnvironmentId - List the deployments for a given definition environment id. + * @param {string} createdBy - List the deployments for which deployments are created as identity specified. + * @param {Date} minModifiedTime - List the deployments with LastModified time >= minModifiedTime. + * @param {Date} maxModifiedTime - List the deployments with LastModified time <= maxModifiedTime. + * @param {ReleaseInterfaces.DeploymentStatus} deploymentStatus - List the deployments with given deployment status. Default is 'All'. + * @param {ReleaseInterfaces.DeploymentOperationStatus} operationStatus - List the deployments with given operation status. Default is 'All'. + * @param {boolean} latestAttemptsOnly - 'true' to include deployments with latest attempt only. Default is 'false'. + * @param {ReleaseInterfaces.ReleaseQueryOrder} queryOrder - List the deployments with given query order. Default is 'Descending'. + * @param {number} top - List the deployments with given top. Default top is '50' and Max top is '100'. + * @param {number} continuationToken - List the deployments with deployment id >= continuationToken. + * @param {string} createdFor - List the deployments for which deployments are requested as identity specified. + * @param {Date} minStartedTime - List the deployments with StartedOn time >= minStartedTime. + * @param {Date} maxStartedTime - List the deployments with StartedOn time <= maxStartedTime. + * @param {string} sourceBranch - List the deployments that are deployed from given branch name. */ - getReleaseRevision(project, releaseId, definitionSnapshotRevision) { + getDeployments(project, definitionId, definitionEnvironmentId, createdBy, minModifiedTime, maxModifiedTime, deploymentStatus, operationStatus, latestAttemptsOnly, queryOrder, top, continuationToken, createdFor, minStartedTime, maxStartedTime, sourceBranch) { return __awaiter(this, void 0, void 0, function* () { - if (definitionSnapshotRevision == null) { - throw new TypeError('definitionSnapshotRevision can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - releaseId: releaseId + project: project }; let queryValues = { - definitionSnapshotRevision: definitionSnapshotRevision, - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.8", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); - let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); - } - catch (err) { - reject(err); - } - })); - }); - } - /** - * Undelete a soft deleted release. - * + definitionId: definitionId, + definitionEnvironmentId: definitionEnvironmentId, + createdBy: createdBy, + minModifiedTime: minModifiedTime, + maxModifiedTime: maxModifiedTime, + deploymentStatus: deploymentStatus, + operationStatus: operationStatus, + latestAttemptsOnly: latestAttemptsOnly, + queryOrder: queryOrder, + '$top': top, + continuationToken: continuationToken, + createdFor: createdFor, + minStartedTime: minStartedTime, + maxStartedTime: maxStartedTime, + sourceBranch: sourceBranch, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "b005ef73-cddc-448e-9ba2-5193bf36b19f", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Deployment, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {ReleaseInterfaces.DeploymentQueryParameters} queryParameters * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of release to be undeleted. - * @param {string} comment - Any comment for undeleting. */ - undeleteRelease(project, releaseId, comment) { + getDeploymentsForMultipleEnvironments(queryParameters, project) { return __awaiter(this, void 0, void 0, function* () { - if (comment == null) { - throw new TypeError('comment can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - releaseId: releaseId - }; - let queryValues = { - comment: comment, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.8", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "b005ef73-cddc-448e-9ba2-5193bf36b19f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, null, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, queryParameters, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Deployment, true); resolve(ret); } catch (err) { @@ -19516,26 +21197,31 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Update a complete release object. + * Get a release environment. * - * @param {ReleaseInterfaces.Release} release - Release object for update. * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release to update. + * @param {number} releaseId - Id of the release. + * @param {number} environmentId - Id of the release environment. + * @param {ReleaseInterfaces.ReleaseEnvironmentExpands} expand - A property that should be expanded in the environment. */ - updateRelease(release, project, releaseId) { + getReleaseEnvironment(project, releaseId, environmentId, expand) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId + releaseId: releaseId, + environmentId: environmentId + }; + let queryValues = { + '$expand': expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.8", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.8", "Release", "a7e426b1-03dc-48af-9dfe-c98bac612dcb", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, release, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Release, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseEnvironment, false); resolve(ret); } catch (err) { @@ -19545,26 +21231,28 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Update few properties of a release. + * Update the status of a release environment * - * @param {ReleaseInterfaces.ReleaseUpdateMetadata} releaseUpdateMetadata - Properties of release to update. + * @param {ReleaseInterfaces.ReleaseEnvironmentUpdateMetadata} environmentUpdateData - Environment update meta data. * @param {string} project - Project ID or project name - * @param {number} releaseId - Id of the release to update. + * @param {number} releaseId - Id of the release. + * @param {number} environmentId - Id of release environment. */ - updateReleaseResource(releaseUpdateMetadata, project, releaseId) { + updateReleaseEnvironment(environmentUpdateData, project, releaseId, environmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId + releaseId: releaseId, + environmentId: environmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.8", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.8", "Release", "a7e426b1-03dc-48af-9dfe-c98bac612dcb", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, releaseUpdateMetadata, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Release, false); + res = yield this.rest.update(url, environmentUpdateData, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseEnvironment, false); resolve(ret); } catch (err) { @@ -19574,23 +21262,24 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets the release settings + * Creates a definition environment template * + * @param {ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate} template - Definition environment template to create * @param {string} project - Project ID or project name */ - getReleaseSettings(project) { + createDefinitionEnvironmentTemplate(template, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "c63c3718-7cfd-41e0-b89b-81c1ca143437", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "6b03b696-824e-4479-8eb2-6644a51aba89", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, template, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionEnvironmentTemplate, false); resolve(ret); } catch (err) { @@ -19600,23 +21289,29 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Updates the release settings + * Delete a definition environment template * - * @param {ReleaseInterfaces.ReleaseSettings} releaseSettings * @param {string} project - Project ID or project name + * @param {string} templateId - Id of the definition environment template */ - updateReleaseSettings(releaseSettings, project) { + deleteDefinitionEnvironmentTemplate(project, templateId) { return __awaiter(this, void 0, void 0, function* () { + if (templateId == null) { + throw new TypeError('templateId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + templateId: templateId, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "c63c3718-7cfd-41e0-b89b-81c1ca143437", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "6b03b696-824e-4479-8eb2-6644a51aba89", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, releaseSettings, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -19627,26 +21322,31 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get release definition for a given definitionId and revision + * Gets a definition environment template * * @param {string} project - Project ID or project name - * @param {number} definitionId - Id of the definition. - * @param {number} revision - Id of the revision. + * @param {string} templateId - Id of the definition environment template */ - getDefinitionRevision(project, definitionId, revision) { + getDefinitionEnvironmentTemplate(project, templateId) { return __awaiter(this, void 0, void 0, function* () { + if (templateId == null) { + throw new TypeError('templateId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - definitionId: definitionId, - revision: revision + project: project + }; + let queryValues = { + templateId: templateId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "258b82e0-9d41-43f3-86d6-fef14ddd44bc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "6b03b696-824e-4479-8eb2-6644a51aba89", routeValues, queryValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionEnvironmentTemplate, false); + resolve(ret); } catch (err) { reject(err); @@ -19655,25 +21355,27 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Get revision history for a release definition + * Gets a list of definition environment templates * * @param {string} project - Project ID or project name - * @param {number} definitionId - Id of the definition. + * @param {boolean} isDeleted - 'true' to get definition environment templates that have been deleted. Default is 'false' */ - getReleaseDefinitionHistory(project, definitionId) { + listDefinitionEnvironmentTemplates(project, isDeleted) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - definitionId: definitionId + project: project + }; + let queryValues = { + isDeleted: isDeleted, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "258b82e0-9d41-43f3-86d6-fef14ddd44bc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "6b03b696-824e-4479-8eb2-6644a51aba89", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionRevision, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionEnvironmentTemplate, true); resolve(ret); } catch (err) { @@ -19683,23 +21385,30 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * Undelete a release definition environment template. + * * @param {string} project - Project ID or project name - * @param {number} releaseId + * @param {string} templateId - Id of the definition environment template to be undeleted */ - getSummaryMailSections(project, releaseId) { + undeleteReleaseDefinitionEnvironmentTemplate(project, templateId) { return __awaiter(this, void 0, void 0, function* () { + if (templateId == null) { + throw new TypeError('templateId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - releaseId: releaseId + project: project + }; + let queryValues = { + templateId: templateId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "224e92b2-8d13-4c14-b120-13d877c516f8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "6b03b696-824e-4479-8eb2-6644a51aba89", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.SummaryMailSection, true); + res = yield this.rest.update(url, null, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionEnvironmentTemplate, false); resolve(ret); } catch (err) { @@ -19709,24 +21418,28 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {ReleaseInterfaces.MailMessage} mailMessage + * @param {ReleaseInterfaces.FavoriteItem[]} favoriteItems * @param {string} project - Project ID or project name - * @param {number} releaseId + * @param {string} scope + * @param {string} identityId */ - sendSummaryMail(mailMessage, project, releaseId) { + createFavorites(favoriteItems, project, scope, identityId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId + scope: scope + }; + let queryValues = { + identityId: identityId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "224e92b2-8d13-4c14-b120-13d877c516f8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "938f7222-9acb-48fe-b8a3-4eda04597171", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, mailMessage, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, favoriteItems, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -19737,22 +21450,28 @@ class ReleaseApi extends basem.ClientApiBase { } /** * @param {string} project - Project ID or project name - * @param {number} definitionId + * @param {string} scope + * @param {string} identityId + * @param {string} favoriteItemIds */ - getSourceBranches(project, definitionId) { + deleteFavorites(project, scope, identityId, favoriteItemIds) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - definitionId: definitionId + scope: scope + }; + let queryValues = { + identityId: identityId, + favoriteItemIds: favoriteItemIds, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "0e5def23-78b3-461f-8198-1558f25041c8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "938f7222-9acb-48fe-b8a3-4eda04597171", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -19762,26 +21481,26 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Adds a tag to a definition - * * @param {string} project - Project ID or project name - * @param {number} releaseDefinitionId - * @param {string} tag + * @param {string} scope + * @param {string} identityId */ - addDefinitionTag(project, releaseDefinitionId, tag) { + getFavorites(project, scope, identityId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseDefinitionId: releaseDefinitionId, - tag: tag + scope: scope + }; + let queryValues = { + identityId: identityId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "3d21b4c8-c32e-45b2-a7cb-770a369012f4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "938f7222-9acb-48fe-b8a3-4eda04597171", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, null, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, true); resolve(ret); } @@ -19792,25 +21511,21 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Adds multiple tags to a definition - * - * @param {string[]} tags - * @param {string} project - Project ID or project name - * @param {number} releaseDefinitionId + * @param {string} flightName */ - addDefinitionTags(tags, project, releaseDefinitionId) { + getFlightAssignments(flightName) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - releaseDefinitionId: releaseDefinitionId + let routeValues = {}; + let queryValues = { + flightName: flightName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "3d21b4c8-c32e-45b2-a7cb-770a369012f4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "409d301f-3046-46f3-beb9-4357fbce0a8c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, tags, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, true); resolve(ret); } @@ -19821,27 +21536,26 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Deletes a tag from a definition + * Creates a new folder. * + * @param {ReleaseInterfaces.Folder} folder - folder. * @param {string} project - Project ID or project name - * @param {number} releaseDefinitionId - * @param {string} tag + * @param {string} path - Path of the folder. */ - deleteDefinitionTag(project, releaseDefinitionId, tag) { + createFolder(folder, project, path) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseDefinitionId: releaseDefinitionId, - tag: tag + path: path }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "3d21b4c8-c32e-45b2-a7cb-770a369012f4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "f7ddf76d-ce0c-4d68-94ff-becaec5d9dea", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, folder, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Folder, false); resolve(ret); } catch (err) { @@ -19851,25 +21565,25 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets the tags for a definition + * Deletes a definition folder for given folder name and path and all it's existing definitions. * * @param {string} project - Project ID or project name - * @param {number} releaseDefinitionId + * @param {string} path - Path of the folder to delete. */ - getDefinitionTags(project, releaseDefinitionId) { + deleteFolder(project, path) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseDefinitionId: releaseDefinitionId + path: path }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "3d21b4c8-c32e-45b2-a7cb-770a369012f4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "f7ddf76d-ce0c-4d68-94ff-becaec5d9dea", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -19879,27 +21593,29 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Adds a tag to a releaseId + * Gets folders. * * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {string} tag + * @param {string} path - Path of the folder. + * @param {ReleaseInterfaces.FolderPathQueryOrder} queryOrder - Gets the results in the defined order. Default is 'None'. */ - addReleaseTag(project, releaseId, tag) { + getFolders(project, path, queryOrder) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId, - tag: tag + path: path + }; + let queryValues = { + queryOrder: queryOrder, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "c5b602b6-d1b3-4363-8a51-94384f78068f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "f7ddf76d-ce0c-4d68-94ff-becaec5d9dea", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, null, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Folder, true); resolve(ret); } catch (err) { @@ -19909,26 +21625,26 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Adds tag to a release + * Updates an existing folder at given existing path. * - * @param {string[]} tags + * @param {ReleaseInterfaces.Folder} folder - folder. * @param {string} project - Project ID or project name - * @param {number} releaseId + * @param {string} path - Path of the folder to update. */ - addReleaseTags(tags, project, releaseId) { + updateFolder(folder, project, path) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId + path: path }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "c5b602b6-d1b3-4363-8a51-94384f78068f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "f7ddf76d-ce0c-4d68-94ff-becaec5d9dea", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, tags, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.update(url, folder, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Folder, false); resolve(ret); } catch (err) { @@ -19938,27 +21654,26 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Deletes a tag from a release + * Updates the gate for a deployment. * + * @param {ReleaseInterfaces.GateUpdateMetadata} gateUpdateMetadata - Metadata to patch the Release Gates. * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {string} tag + * @param {number} gateStepId - Gate step Id. */ - deleteReleaseTag(project, releaseId, tag) { + updateGates(gateUpdateMetadata, project, gateStepId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId, - tag: tag + gateStepId: gateStepId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "c5b602b6-d1b3-4363-8a51-94384f78068f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "2666a539-2001-4f80-bcc7-0379956749d4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.update(url, gateUpdateMetadata, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseGates, false); resolve(ret); } catch (err) { @@ -19968,12 +21683,10 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * Gets the tags for a release - * * @param {string} project - Project ID or project name * @param {number} releaseId */ - getReleaseTags(project, releaseId) { + getReleaseHistory(project, releaseId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { @@ -19981,12 +21694,12 @@ class ReleaseApi extends basem.ClientApiBase { releaseId: releaseId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "c5b602b6-d1b3-4363-8a51-94384f78068f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "23f461c8-629a-4144-a076-3054fa5f268a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseRevision, true); resolve(ret); } catch (err) { @@ -19996,21 +21709,22 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * @param {FormInputInterfaces.InputValuesQuery} query * @param {string} project - Project ID or project name */ - getTags(project) { + getInputValues(query, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "86cee25a-68ba-4ba3-9171-8ad6ffc6df93", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "71dd499b-317d-45ea-9134-140ea1932b5e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, query, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -20021,26 +21735,26 @@ class ReleaseApi extends basem.ClientApiBase { } /** * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - * @param {number} releaseDeployPhaseId + * @param {number} buildId + * @param {string} sourceId */ - getTasksForTaskGroup(project, releaseId, environmentId, releaseDeployPhaseId) { + getIssues(project, buildId, sourceId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - releaseId: releaseId, - environmentId: environmentId, - releaseDeployPhaseId: releaseDeployPhaseId + buildId: buildId + }; + let queryValues = { + sourceId: sourceId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "4259191d-4b0a-4409-9fb3-09f22ab9bc47", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "cd42261a-f5c6-41c8-9259-f078989b9f25", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseTask, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.AutoTriggerIssue, true); resolve(ret); } catch (err) { @@ -20050,30 +21764,30 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * Gets gate logs + * * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - * @param {number} attemptId - * @param {string} timelineId + * @param {number} releaseId - Id of the release. + * @param {number} environmentId - Id of release environment. + * @param {number} gateId - Id of the gate. + * @param {number} taskId - ReleaseTask Id for the log. */ - getTasks2(project, releaseId, environmentId, attemptId, timelineId) { + getGateLog(project, releaseId, environmentId, gateId, taskId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, releaseId: releaseId, environmentId: environmentId, - attemptId: attemptId, - timelineId: timelineId + gateId: gateId, + taskId: taskId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "4259291d-4b0a-4409-9fb3-04f22ab9bc47", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "dec7ca5a-7f7f-4797-8bf1-8efc0dc93b28", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseTask, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -20082,30 +21796,58 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * Get logs for a release Id. + * * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - * @param {number} attemptId + * @param {number} releaseId - Id of the release. */ - getTasks(project, releaseId, environmentId, attemptId) { + getLogs(project, releaseId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + releaseId: releaseId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "c37fbab5-214b-48e4-a55b-cb6b4f6e4038", routeValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Gets logs + * + * @param {string} project - Project ID or project name + * @param {number} releaseId - Id of the release. + * @param {number} environmentId - Id of release environment. + * @param {number} taskId - ReleaseTask Id for the log. + * @param {number} attemptId - Id of the attempt. + */ + getLog(project, releaseId, environmentId, taskId, attemptId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, releaseId: releaseId, - environmentId: environmentId + environmentId: environmentId, + taskId: taskId }; let queryValues = { attemptId: attemptId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Release", "36b276e0-3c70-4320-a63c-1a2e1466a0d1", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "e71ba1ed-c0a4-4a28-a61f-2dd5f68cf3fd", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseTask, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -20114,22 +21856,38 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * Gets the task log of a release as a plain text file. + * * @param {string} project - Project ID or project name + * @param {number} releaseId - Id of the release. + * @param {number} environmentId - Id of release environment. + * @param {number} attemptId + * @param {string} timelineId + * @param {number} taskId - ReleaseTask Id for the log. + * @param {number} startLine - Starting line number for logs + * @param {number} endLine - Ending line number for logs */ - getArtifactTypeDefinitions(project) { + getTaskLog2(project, releaseId, environmentId, attemptId, timelineId, taskId, startLine, endLine) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + releaseId: releaseId, + environmentId: environmentId, + attemptId: attemptId, + timelineId: timelineId, + taskId: taskId + }; + let queryValues = { + startLine: startLine, + endLine: endLine, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "8efc2a3c-1fc8-4f6d-9822-75e98cecb48f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "2577e6c3-6999-4400-bc69-fe1d837755fe", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ArtifactTypeDefinition, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -20138,29 +21896,36 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * Gets the task log of a release as a plain text file. + * * @param {string} project - Project ID or project name - * @param {number} releaseDefinitionId + * @param {number} releaseId - Id of the release. + * @param {number} environmentId - Id of release environment. + * @param {number} releaseDeployPhaseId - Release deploy phase Id. + * @param {number} taskId - ReleaseTask Id for the log. + * @param {number} startLine - Starting line number for logs + * @param {number} endLine - Ending line number for logs */ - getArtifactVersions(project, releaseDefinitionId) { + getTaskLog(project, releaseId, environmentId, releaseDeployPhaseId, taskId, startLine, endLine) { return __awaiter(this, void 0, void 0, function* () { - if (releaseDefinitionId == null) { - throw new TypeError('releaseDefinitionId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + releaseId: releaseId, + environmentId: environmentId, + releaseDeployPhaseId: releaseDeployPhaseId, + taskId: taskId }; let queryValues = { - releaseDefinitionId: releaseDefinitionId, + startLine: startLine, + endLine: endLine, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "30fc787e-a9e0-4a07-9fbc-3e903aa051d2", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "17c91af7-09fd-4256-bff1-c24ee4f73bc0", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ArtifactVersionQueryResult, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -20169,22 +21934,27 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** - * @param {ReleaseInterfaces.Artifact[]} artifacts + * Get manual intervention for a given release and manual intervention id. + * * @param {string} project - Project ID or project name + * @param {number} releaseId - Id of the release. + * @param {number} manualInterventionId - Id of the manual intervention. */ - getArtifactVersionsForSources(artifacts, project) { + getManualIntervention(project, releaseId, manualInterventionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + releaseId: releaseId, + manualInterventionId: manualInterventionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "30fc787e-a9e0-4a07-9fbc-3e903aa051d2", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "616c46e4-f370-4456-adaa-fbaf79c7b79e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, artifacts, options); - let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ArtifactVersionQueryResult, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ManualIntervention, false); resolve(ret); } catch (err) { @@ -20194,31 +21964,25 @@ class ReleaseApi extends basem.ClientApiBase { }); } /** + * List all manual interventions for a given release. + * * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} baseReleaseId - * @param {number} top - * @param {string} artifactAlias + * @param {number} releaseId - Id of the release. */ - getReleaseWorkItemsRefs(project, releaseId, baseReleaseId, top, artifactAlias) { + getManualInterventions(project, releaseId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, releaseId: releaseId }; - let queryValues = { - baseReleaseId: baseReleaseId, - '$top': top, - artifactAlias: artifactAlias, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Release", "4f165cc0-875c-4768-b148-f12f78769fab", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "616c46e4-f370-4456-adaa-fbaf79c7b79e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ManualIntervention, true); resolve(ret); } catch (err) { @@ -20227,60 +21991,57 @@ class ReleaseApi extends basem.ClientApiBase { })); }); } -} -ReleaseApi.RESOURCE_AREA_ID = "efc2f575-36ef-48e9-b672-0c6fb4a48ac5"; -exports.ReleaseApi = ReleaseApi; - - -/***/ }), - -/***/ 806: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const SecurityRolesInterfaces = __nccwpck_require__(6573); -class SecurityRolesApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-SecurityRoles-api', options); + /** + * Update manual intervention. + * + * @param {ReleaseInterfaces.ManualInterventionUpdateMetadata} manualInterventionUpdateMetadata - Meta data to update manual intervention. + * @param {string} project - Project ID or project name + * @param {number} releaseId - Id of the release. + * @param {number} manualInterventionId - Id of the manual intervention. + */ + updateManualIntervention(manualInterventionUpdateMetadata, project, releaseId, manualInterventionId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + releaseId: releaseId, + manualInterventionId: manualInterventionId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "616c46e4-f370-4456-adaa-fbaf79c7b79e", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, manualInterventionUpdateMetadata, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ManualIntervention, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); } /** - * @param {string} scopeId - * @param {string} resourceId + * @param {string} project - Project ID or project name + * @param {Date} minMetricsTime */ - getRoleAssignments(scopeId, resourceId) { + getMetrics(project, minMetricsTime) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeId: scopeId, - resourceId: resourceId + project: project + }; + let queryValues = { + minMetricsTime: minMetricsTime, }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "9461c234-c84c-4ed2-b918-2f0f92ad0a35", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "cd1502bb-3c73-4e11-80a6-d11308dceae5", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, SecurityRolesInterfaces.TypeInfo.RoleAssignment, true); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -20290,24 +22051,69 @@ class SecurityRolesApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeId - * @param {string} resourceId - * @param {string} identityId + * Gets Org pipeline release settings + * */ - removeRoleAssignment(scopeId, resourceId, identityId) { + getOrgPipelineReleaseSettings() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "d156c759-ca4e-492b-90d4-db03971796ea", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates Org pipeline release settings + * + * @param {ReleaseInterfaces.OrgPipelineReleaseSettingsUpdateParameters} newSettings + */ + updateOrgPipelineReleaseSettings(newSettings) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "d156c759-ca4e-492b-90d4-db03971796ea", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, newSettings, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Gets pipeline release settings + * + * @param {string} project - Project ID or project name + */ + getPipelineReleaseSettings(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeId: scopeId, - resourceId: resourceId, - identityId: identityId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "9461c234-c84c-4ed2-b918-2f0f92ad0a35", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "e816b9f4-f9fe-46ba-bdcc-a9af6abf3144", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -20318,23 +22124,23 @@ class SecurityRolesApi extends basem.ClientApiBase { }); } /** - * @param {string[]} identityIds - * @param {string} scopeId - * @param {string} resourceId + * Updates pipeline release settings + * + * @param {ReleaseInterfaces.ProjectPipelineReleaseSettingsUpdateParameters} newSettings + * @param {string} project - Project ID or project name */ - removeRoleAssignments(identityIds, scopeId, resourceId) { + updatePipelineReleaseSettings(newSettings, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeId: scopeId, - resourceId: resourceId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "9461c234-c84c-4ed2-b918-2f0f92ad0a35", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "e816b9f4-f9fe-46ba-bdcc-a9af6abf3144", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, identityIds, options); + res = yield this.rest.update(url, newSettings, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -20345,26 +22151,100 @@ class SecurityRolesApi extends basem.ClientApiBase { }); } /** - * @param {SecurityRolesInterfaces.UserRoleAssignmentRef} roleAssignment - * @param {string} scopeId - * @param {string} resourceId - * @param {string} identityId + * @param {string} artifactType + * @param {string} artifactSourceId */ - setRoleAssignment(roleAssignment, scopeId, resourceId, identityId) { + getReleaseProjects(artifactType, artifactSourceId) { + return __awaiter(this, void 0, void 0, function* () { + if (artifactType == null) { + throw new TypeError('artifactType can not be null or undefined'); + } + if (artifactSourceId == null) { + throw new TypeError('artifactSourceId can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + artifactType: artifactType, + artifactSourceId: artifactSourceId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "917ace4a-79d1-45a7-987c-7be4db4268fa", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get a list of releases + * + * @param {string} project - Project ID or project name + * @param {number} definitionId - Releases from this release definition Id. + * @param {number} definitionEnvironmentId + * @param {string} searchText - Releases with names containing searchText. + * @param {string} createdBy - Releases created by this user. + * @param {ReleaseInterfaces.ReleaseStatus} statusFilter - Releases that have this status. + * @param {number} environmentStatusFilter + * @param {Date} minCreatedTime - Releases that were created after this time. + * @param {Date} maxCreatedTime - Releases that were created before this time. + * @param {ReleaseInterfaces.ReleaseQueryOrder} queryOrder - Gets the results in the defined order of created date for releases. Default is descending. + * @param {number} top - Number of releases to get. Default is 50. + * @param {number} continuationToken - Gets the releases after the continuation token provided. + * @param {ReleaseInterfaces.ReleaseExpands} expand - The property that should be expanded in the list of releases. + * @param {string} artifactTypeId - Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. + * @param {string} sourceId - Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. + * @param {string} artifactVersionId - Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId. + * @param {string} sourceBranchFilter - Releases with given sourceBranchFilter will be returned (Not to be used with environmentStatusFilter). + * @param {boolean} isDeleted - Gets the soft deleted releases, if true. + * @param {string[]} tagFilter - A comma-delimited list of tags. Only releases with these tags will be returned. + * @param {string[]} propertyFilters - A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not. + * @param {number[]} releaseIdFilter - A comma-delimited list of releases Ids. Only releases with these Ids will be returned. + * @param {string} path - Releases under this folder path will be returned + */ + getReleases(project, definitionId, definitionEnvironmentId, searchText, createdBy, statusFilter, environmentStatusFilter, minCreatedTime, maxCreatedTime, queryOrder, top, continuationToken, expand, artifactTypeId, sourceId, artifactVersionId, sourceBranchFilter, isDeleted, tagFilter, propertyFilters, releaseIdFilter, path) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeId: scopeId, - resourceId: resourceId, - identityId: identityId + project: project + }; + let queryValues = { + definitionId: definitionId, + definitionEnvironmentId: definitionEnvironmentId, + searchText: searchText, + createdBy: createdBy, + statusFilter: statusFilter, + environmentStatusFilter: environmentStatusFilter, + minCreatedTime: minCreatedTime, + maxCreatedTime: maxCreatedTime, + queryOrder: queryOrder, + '$top': top, + continuationToken: continuationToken, + '$expand': expand, + artifactTypeId: artifactTypeId, + sourceId: sourceId, + artifactVersionId: artifactVersionId, + sourceBranchFilter: sourceBranchFilter, + isDeleted: isDeleted, + tagFilter: tagFilter && tagFilter.join(","), + propertyFilters: propertyFilters && propertyFilters.join(","), + releaseIdFilter: releaseIdFilter && releaseIdFilter.join(","), + path: path, }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "9461c234-c84c-4ed2-b918-2f0f92ad0a35", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.9", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, roleAssignment, options); - let ret = this.formatResponse(res.result, SecurityRolesInterfaces.TypeInfo.RoleAssignment, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Release, true); resolve(ret); } catch (err) { @@ -20374,24 +22254,24 @@ class SecurityRolesApi extends basem.ClientApiBase { }); } /** - * @param {SecurityRolesInterfaces.UserRoleAssignmentRef[]} roleAssignments - * @param {string} scopeId - * @param {string} resourceId + * Create a release. + * + * @param {ReleaseInterfaces.ReleaseStartMetadata} releaseStartMetadata - Metadata to create a release. + * @param {string} project - Project ID or project name */ - setRoleAssignments(roleAssignments, scopeId, resourceId) { + createRelease(releaseStartMetadata, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeId: scopeId, - resourceId: resourceId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "9461c234-c84c-4ed2-b918-2f0f92ad0a35", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.9", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, roleAssignments, options); - let ret = this.formatResponse(res.result, SecurityRolesInterfaces.TypeInfo.RoleAssignment, true); + res = yield this.rest.create(url, releaseStartMetadata, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Release, false); resolve(ret); } catch (err) { @@ -20401,21 +22281,69 @@ class SecurityRolesApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeId + * Soft delete a release + * + * @param {string} project - Project ID or project name + * @param {number} releaseId - Id of the release. + * @param {string} comment - Comment for deleting a release. */ - getRoleDefinitions(scopeId) { + deleteRelease(project, releaseId, comment) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeId: scopeId + project: project, + releaseId: releaseId + }; + let queryValues = { + comment: comment, }; try { - let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "f4cc9a86-453c-48d2-b44d-d3bd5c105f4f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.9", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get a Release + * + * @param {string} project - Project ID or project name + * @param {number} releaseId - Id of the release. + * @param {ReleaseInterfaces.ApprovalFilters} approvalFilters - A filter which would allow fetching approval steps selectively based on whether it is automated, or manual. This would also decide whether we should fetch pre and post approval snapshots. Assumes All by default + * @param {string[]} propertyFilters - A comma-delimited list of extended properties to be retrieved. If set, the returned Release will contain values for the specified property Ids (if they exist). If not set, properties will not be included. + * @param {ReleaseInterfaces.SingleReleaseExpands} expand - A property that should be expanded in the release. + * @param {number} topGateRecords - Number of release gate records to get. Default is 5. + * @param {boolean} includeDisabledDefinitions - Include disabled definitions (if set to 'false' returns error, default is 'true') + */ + getRelease(project, releaseId, approvalFilters, propertyFilters, expand, topGateRecords, includeDisabledDefinitions) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + releaseId: releaseId + }; + let queryValues = { + approvalFilters: approvalFilters, + propertyFilters: propertyFilters && propertyFilters.join(","), + '$expand': expand, + '$topGateRecords': topGateRecords, + includeDisabledDefinitions: includeDisabledDefinitions, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.9", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Release, false); resolve(ret); } catch (err) { @@ -20424,451 +22352,167 @@ class SecurityRolesApi extends basem.ClientApiBase { })); }); } -} -exports.SecurityRolesApi = SecurityRolesApi; - - -/***/ }), - -/***/ 5817: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -/** -* Module for handling serialization and deserialization of data contracts -* (contracts sent from the server using the VSO default REST api serialization settings) -*/ -var ContractSerializer; -(function (ContractSerializer) { - var _legacyDateRegExp; /** - * Process a contract in its raw form (e.g. date fields are Dates, and Enums are numbers) and - * return a pure JSON object that can be posted to REST endpoint. + * Get release summary of a given definition Id. * - * @param data The object to serialize - * @param contractMetadata The type info/metadata for the contract type being serialized - * @param preserveOriginal If true, don't modify the original object. False modifies the original object (the return value points to the data argument). + * @param {string} project - Project ID or project name + * @param {number} definitionId - Id of the definition to get release summary. + * @param {number} releaseCount - Count of releases to be included in summary. + * @param {boolean} includeArtifact - Include artifact details.Default is 'false'. + * @param {number[]} definitionEnvironmentIdsFilter */ - function serialize(data, contractMetadata, preserveOriginal) { - if (data && contractMetadata) { - if (Array.isArray(data)) { - return _getTranslatedArray(data, contractMetadata, true, preserveOriginal); + getReleaseDefinitionSummary(project, definitionId, releaseCount, includeArtifact, definitionEnvironmentIdsFilter) { + return __awaiter(this, void 0, void 0, function* () { + if (definitionId == null) { + throw new TypeError('definitionId can not be null or undefined'); } - else { - return _getTranslatedObject(data, contractMetadata, true, preserveOriginal); + if (releaseCount == null) { + throw new TypeError('releaseCount can not be null or undefined'); } - } - else { - return data; - } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + definitionId: definitionId, + releaseCount: releaseCount, + includeArtifact: includeArtifact, + definitionEnvironmentIdsFilter: definitionEnvironmentIdsFilter && definitionEnvironmentIdsFilter.join(","), + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.9", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionSummary, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); } - ContractSerializer.serialize = serialize; /** - * Process a pure JSON object (e.g. that came from a REST call) and transform it into a JS object - * where date strings are converted to Date objects and enum values are converted from strings into - * their numerical value. + * Get release for a given revision number. * - * @param data The object to deserialize - * @param contractMetadata The type info/metadata for the contract type being deserialize - * @param preserveOriginal If true, don't modify the original object. False modifies the original object (the return value points to the data argument). - * @param unwrapWrappedCollections If true check for wrapped arrays (REST apis will not return arrays directly as the root result but will instead wrap them in a { values: [], count: 0 } object. + * @param {string} project - Project ID or project name + * @param {number} releaseId - Id of the release. + * @param {number} definitionSnapshotRevision - Definition snapshot revision number. */ - function deserialize(data, contractMetadata, preserveOriginal, unwrapWrappedCollections) { - if (data) { - if (unwrapWrappedCollections && Array.isArray(data.value)) { - // Wrapped json array - unwrap it and send the array as the result - data = data.value; + getReleaseRevision(project, releaseId, definitionSnapshotRevision) { + return __awaiter(this, void 0, void 0, function* () { + if (definitionSnapshotRevision == null) { + throw new TypeError('definitionSnapshotRevision can not be null or undefined'); } - if (contractMetadata) { - if (Array.isArray(data)) { - data = _getTranslatedArray(data, contractMetadata, false, preserveOriginal); + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + releaseId: releaseId + }; + let queryValues = { + definitionSnapshotRevision: definitionSnapshotRevision, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.9", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } - else { - data = _getTranslatedObject(data, contractMetadata, false, preserveOriginal); + catch (err) { + reject(err); } - } - } - return data; + })); + }); } - ContractSerializer.deserialize = deserialize; - function _getTranslatedArray(array, typeMetadata, serialize, preserveOriginal) { - var resultArray = array; - var arrayCopy = []; - var i; - for (i = 0; i < array.length; i++) { - var item = array[i]; - var processedItem; - // handle arrays of arrays - if (Array.isArray(item)) { - processedItem = _getTranslatedArray(item, typeMetadata, serialize, preserveOriginal); - } - else { - processedItem = _getTranslatedObject(item, typeMetadata, serialize, preserveOriginal); + /** + * Undelete a soft deleted release. + * + * @param {string} project - Project ID or project name + * @param {number} releaseId - Id of release to be undeleted. + * @param {string} comment - Any comment for undeleting. + */ + undeleteRelease(project, releaseId, comment) { + return __awaiter(this, void 0, void 0, function* () { + if (comment == null) { + throw new TypeError('comment can not be null or undefined'); } - if (preserveOriginal) { - arrayCopy.push(processedItem); - if (processedItem !== item) { - resultArray = arrayCopy; + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + releaseId: releaseId + }; + let queryValues = { + comment: comment, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.9", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, null, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); } - } - else { - array[i] = processedItem; - } - } - return resultArray; + catch (err) { + reject(err); + } + })); + }); } - function _getTranslatedObject(typeObject, typeMetadata, serialize, preserveOriginal) { - var processedItem = typeObject, copiedItem = false; - if (typeObject && typeMetadata.fields) { - for (var fieldName in typeMetadata.fields) { - var fieldMetadata = typeMetadata.fields[fieldName]; - var fieldValue = typeObject[fieldName]; - var translatedValue = _getTranslatedField(fieldValue, fieldMetadata, serialize, preserveOriginal); - if (fieldValue !== translatedValue) { - if (preserveOriginal && !copiedItem) { - processedItem = this._extend({}, typeObject); - copiedItem = true; - } - processedItem[fieldName] = translatedValue; + /** + * Update a complete release object. + * + * @param {ReleaseInterfaces.Release} release - Release object for update. + * @param {string} project - Project ID or project name + * @param {number} releaseId - Id of the release to update. + */ + updateRelease(release, project, releaseId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + releaseId: releaseId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.9", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, release, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Release, false); + resolve(ret); } - } - } - return processedItem; - } - function _getTranslatedField(fieldValue, fieldMetadata, serialize, preserveOriginal) { - if (!fieldValue) { - return fieldValue; - } - if (fieldMetadata.isArray) { - if (Array.isArray(fieldValue)) { - var newArray = [], processedArray = fieldValue; - for (var index = 0; index < fieldValue.length; index++) { - var arrayValue = fieldValue[index]; - var processedValue = arrayValue; - if (fieldMetadata.isDate) { - processedValue = _getTranslatedDateValue(arrayValue, serialize); - } - else if (fieldMetadata.enumType) { - processedValue = _getTranslatedEnumValue(fieldMetadata.enumType, arrayValue, serialize); - } - else if (fieldMetadata.typeInfo) { - if (Array.isArray(arrayValue)) { - processedValue = _getTranslatedArray(arrayValue, fieldMetadata.typeInfo, serialize, preserveOriginal); - } - else { - processedValue = _getTranslatedObject(arrayValue, fieldMetadata.typeInfo, serialize, preserveOriginal); - } - } - if (preserveOriginal) { - newArray.push(processedValue); - if (processedValue !== arrayValue) { - processedArray = newArray; - } - } - else { - fieldValue[index] = processedValue; - } - } - return processedArray; - } - else { - return fieldValue; - } - } - else if (fieldMetadata.isDictionary) { - var dictionaryModified = false; - var newDictionary = {}; - for (var key in fieldValue) { - var dictionaryValue = fieldValue[key]; - var newKey = key, newValue = dictionaryValue; - if (fieldMetadata.dictionaryKeyIsDate) { - newKey = _getTranslatedDateValue(key, serialize); - } - else if (fieldMetadata.dictionaryKeyEnumType) { - newKey = _getTranslatedEnumValue(fieldMetadata.dictionaryKeyEnumType, key, serialize); - } - if (fieldMetadata.dictionaryValueIsDate) { - newValue = _getTranslatedDateValue(dictionaryValue, serialize); - } - else if (fieldMetadata.dictionaryValueEnumType) { - newValue = _getTranslatedEnumValue(fieldMetadata.dictionaryValueEnumType, dictionaryValue, serialize); - } - else if (fieldMetadata.dictionaryValueTypeInfo) { - newValue = _getTranslatedObject(newValue, fieldMetadata.dictionaryValueTypeInfo, serialize, preserveOriginal); - } - else if (fieldMetadata.dictionaryValueFieldInfo) { - newValue = _getTranslatedField(dictionaryValue, fieldMetadata.dictionaryValueFieldInfo, serialize, preserveOriginal); - } - newDictionary[newKey] = newValue; - if (key !== newKey || dictionaryValue !== newValue) { - dictionaryModified = true; - } - } - return dictionaryModified ? newDictionary : fieldValue; - } - else { - if (fieldMetadata.isDate) { - return _getTranslatedDateValue(fieldValue, serialize); - } - else if (fieldMetadata.enumType) { - return _getTranslatedEnumValue(fieldMetadata.enumType, fieldValue, serialize); - } - else if (fieldMetadata.typeInfo) { - return _getTranslatedObject(fieldValue, fieldMetadata.typeInfo, serialize, preserveOriginal); - } - else { - return fieldValue; - } - } - } - function _getTranslatedEnumValue(enumType, valueToConvert, serialize) { - if (serialize && typeof valueToConvert === "number") { - // Serialize: number --> String - // Because webapi handles the numerical value for enums, there is no need to convert to string. - // Let this fall through to return the numerical value. - } - else if (!serialize && typeof valueToConvert === "string") { - // Deserialize: String --> number - var result = 0; - if (valueToConvert) { - var splitValue = valueToConvert.split(","); - for (var i = 0; i < splitValue.length; i++) { - var valuePart = splitValue[i]; - //equivalent to jquery trim - //copied from https://github.com/HubSpot/youmightnotneedjquery/blob/ef987223c20e480fcbfb5924d96c11cd928e1226/comparisons/utils/trim/ie8.js - var enumName = valuePart.replace(/^\s+|\s+$/g, '') || ""; - if (enumName) { - var resultPart = enumType.enumValues[enumName]; - if (!resultPart) { - // No matching enum value. Try again but case insensitive - var lowerCaseEnumName = enumName.toLowerCase(); - if (lowerCaseEnumName !== enumName) { - for (var name in enumType.enumValues) { - var value = enumType.enumValues[name]; - if (name.toLowerCase() === lowerCaseEnumName) { - resultPart = value; - break; - } - } - } - } - if (resultPart) { - result |= resultPart; - } - } - } - } - return result; - } - return valueToConvert; - } - function _getTranslatedDateValue(valueToConvert, serialize) { - if (!serialize && typeof valueToConvert === "string") { - // Deserialize: String --> Date - var dateValue = new Date(valueToConvert); - if (isNaN(dateValue) && navigator.userAgent && /msie/i.test(navigator.userAgent)) { - dateValue = _convertLegacyIEDate(valueToConvert); - } - return dateValue; - } - return valueToConvert; - } - function _convertLegacyIEDate(dateStringValue) { - // IE 8/9 does not handle parsing dates in ISO form like: - // 2013-05-13T14:26:54.397Z - var match; - if (!_legacyDateRegExp) { - _legacyDateRegExp = new RegExp("(\\d+)-(\\d+)-(\\d+)T(\\d+):(\\d+):(\\d+).(\\d+)Z"); - } - match = _legacyDateRegExp.exec(dateStringValue); - if (match) { - return new Date(Date.UTC(parseInt(match[1]), parseInt(match[2]) - 1, parseInt(match[3]), parseInt(match[4]), parseInt(match[5]), parseInt(match[6]), parseInt(match[7]))); - } - else { - return null; - } - } - // jquery extend method in native javascript (used to clone objects) - // copied from https://github.com/HubSpot/youmightnotneedjquery/blob/ef987223c20e480fcbfb5924d96c11cd928e1226/comparisons/utils/extend/ie8.js - var _extend = function (out) { - out = out || {}; - for (var i = 1; i < arguments.length; i++) { - if (!arguments[i]) - continue; - for (var key in arguments[i]) { - if (arguments[i].hasOwnProperty(key)) - out[key] = arguments[i][key]; - } - } - return out; - }; -})(ContractSerializer = exports.ContractSerializer || (exports.ContractSerializer = {})); - - -/***/ }), - -/***/ 5899: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const taskagentbasem = __nccwpck_require__(3390); -const url = __nccwpck_require__(7310); -class TaskAgentApi extends taskagentbasem.TaskAgentApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, options); - // hang on to the handlers in case we need to fall back to an account-level client - this._handlers = handlers; - this._options = options; - } - /** - * @param {string} taskId - * @param onResult callback function - */ - deleteTaskDefinition(taskId) { - let promise = this.vsoClient.beginGetLocation("distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd") - .then((location) => { - if (location) { - // the resource exists at the url we were given. go! - return super.deleteTaskDefinition(taskId); - } - else { - // this is the case when the server doesn't support collection-level task definitions - var fallbackClient = this._getFallbackClient(this.baseUrl); - if (!fallbackClient) { - // couldn't convert - throw new Error("Failed to find api location for area: distributedtask id: 60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd"); - } - else { - // use the fallback client - return fallbackClient.deleteTaskDefinition(taskId); - } - } - }); - return promise; - } - /** - * @param {string} taskId - * @param {string} versionString - * @param {string[]} visibility - * @param {boolean} scopeLocal - * @param onResult callback function with the resulting ArrayBuffer - */ - getTaskContentZip(taskId, versionString, visibility, scopeLocal) { - let promise = this.vsoClient.beginGetLocation("distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd") - .then((location) => { - if (location) { - // the resource exists at the url we were given. go! - return super.getTaskContentZip(taskId, versionString, visibility, scopeLocal); - } - else { - // this is the case when the server doesn't support collection-level task definitions - var fallbackClient = this._getFallbackClient(this.baseUrl); - if (!fallbackClient) { - // couldn't convert - throw new Error("Failed to find api location for area: distributedtask id: 60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd"); - } - else { - // use the fallback client - return fallbackClient.getTaskContentZip(taskId, versionString, visibility, scopeLocal); - } - } - }); - return promise; - } - /** - * @param {string} taskId - * @param {string} versionString - * @param {string[]} visibility - * @param {boolean} scopeLocal - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskDefinition - */ - getTaskDefinition(taskId, versionString, visibility, scopeLocal) { - let promise = this.vsoClient.beginGetLocation("distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd") - .then((location) => { - if (location) { - // the resource exists at the url we were given. go! - return super.getTaskDefinition(taskId, versionString, visibility, scopeLocal); - } - else { - // this is the case when the server doesn't support collection-level task definitions - var fallbackClient = this._getFallbackClient(this.baseUrl); - if (!fallbackClient) { - // couldn't convert - throw new Error("Failed to find api location for area: distributedtask id: 60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd"); - } - else { - // use the fallback client - return fallbackClient.getTaskDefinition(taskId, versionString, visibility, scopeLocal); - } - } - }); - return promise; - } - /** - * @param {string} taskId - * @param {string[]} visibility - * @param {boolean} scopeLocal - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskDefinition[] - */ - getTaskDefinitions(taskId, visibility, scopeLocal) { - let promise = this.vsoClient.beginGetLocation("distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd") - .then((location) => { - if (location) { - // the resource exists at the url we were given. go! - return super.getTaskDefinitions(taskId, visibility, scopeLocal); - } - else { - // this is the case when the server doesn't support collection-level task definitions - var fallbackClient = this._getFallbackClient(this.baseUrl); - if (!fallbackClient) { - // couldn't convert - throw new Error("Failed to find api location for area: distributedtask id: 60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd"); - } - else { - // use the fallback client - return fallbackClient.getTaskDefinitions(taskId, visibility, scopeLocal); - } - } - }); - return promise; + catch (err) { + reject(err); + } + })); + }); } /** - * @param {NodeJS.ReadableStream} contentStream - * @param {string} taskId - * @param {boolean} overwrite - * @param onResult callback function + * Update few properties of a release. + * + * @param {ReleaseInterfaces.ReleaseUpdateMetadata} releaseUpdateMetadata - Properties of release to update. + * @param {string} project - Project ID or project name + * @param {number} releaseId - Id of the release to update. */ - uploadTaskDefinition(customHeaders, contentStream, taskId, overwrite) { + updateReleaseResource(releaseUpdateMetadata, project, releaseId) { return __awaiter(this, void 0, void 0, function* () { - let routeValues = { - taskId: taskId - }; - let queryValues = { - overwrite: overwrite, - }; return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - customHeaders = customHeaders || {}; - customHeaders["Content-Type"] = "application/octet-stream"; + let routeValues = { + project: project, + releaseId: releaseId + }; try { - let verData = yield this.vsoClient.getVersioningData("3.0-preview.1", "distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.9", "Release", "a166fde7-27ad-408e-ba75-703c2cc9d500", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); - options.additionalHeaders = customHeaders; let res; - res = yield this.rest.uploadStream("PUT", url, contentStream, options); - resolve(res.result); + res = yield this.rest.update(url, releaseUpdateMetadata, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.Release, false); + resolve(ret); } catch (err) { reject(err); @@ -20876,90 +22520,23 @@ class TaskAgentApi extends taskagentbasem.TaskAgentApiBase { })); }); } - _getFallbackClient(baseUrl) { - if (!this._fallbackClient) { - var accountUrl = this._getAccountUrl(baseUrl); - if (accountUrl) { - this._fallbackClient = new TaskAgentApi(accountUrl, this._handlers, this._options); - } - } - return this._fallbackClient; - } - _getAccountUrl(collectionUrl) { - // converts a collection URL to an account URL - // returns null if the conversion can't be made - var purl = url.parse(collectionUrl); - if (!purl.protocol || !purl.host) { - return null; - } - var accountUrl = purl.protocol + '//' + purl.host; - // purl.path is something like /DefaultCollection or /tfs/DefaultCollection or /DefaultCollection/ - var splitPath = purl.path.split('/').slice(1); - if (splitPath.length === 0 || (splitPath.length === 1 && splitPath[0] === '')) { - return null; - } - // if the first segment of the path is tfs, the second is the collection. if the url ends in / there will be a third, empty entry - if (splitPath[0] === 'tfs' && (splitPath.length === 2 || (splitPath.length === 3 && splitPath[2].length === 0))) { - //on prem - accountUrl += '/' + 'tfs'; - } - else if (splitPath.length === 2 && splitPath[0] === '') { - // /DefaultCollection/ - return accountUrl; - } - else if (splitPath.length > 1) { - return null; - } - return accountUrl; - } -} -exports.TaskAgentApi = TaskAgentApi; - - -/***/ }), - -/***/ 3390: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const TaskAgentInterfaces = __nccwpck_require__(9565); -class TaskAgentApiBase extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-TaskAgent-api', options); - } /** - * @param {TaskAgentInterfaces.TaskAgentCloud} agentCloud + * Gets the release settings + * + * @param {string} project - Project ID or project name */ - addAgentCloud(agentCloud) { + getReleaseSettings(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "bfa72b3d-0fc6-43fb-932b-a7f6559f93b9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "c63c3718-7cfd-41e0-b89b-81c1ca143437", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, agentCloud, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -20970,20 +22547,23 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} agentCloudId + * Updates the release settings + * + * @param {ReleaseInterfaces.ReleaseSettings} releaseSettings + * @param {string} project - Project ID or project name */ - deleteAgentCloud(agentCloudId) { + updateReleaseSettings(releaseSettings, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - agentCloudId: agentCloudId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "bfa72b3d-0fc6-43fb-932b-a7f6559f93b9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "c63c3718-7cfd-41e0-b89b-81c1ca143437", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.replace(url, releaseSettings, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -20994,22 +22574,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} agentCloudId + * Get release definition for a given definitionId and revision + * + * @param {string} project - Project ID or project name + * @param {number} definitionId - Id of the definition. + * @param {number} revision - Id of the revision. */ - getAgentCloud(agentCloudId) { + getDefinitionRevision(project, definitionId, revision) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - agentCloudId: agentCloudId + project: project, + definitionId: definitionId, + revision: revision }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "bfa72b3d-0fc6-43fb-932b-a7f6559f93b9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "258b82e0-9d41-43f3-86d6-fef14ddd44bc", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -21018,18 +22602,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * Get revision history for a release definition + * + * @param {string} project - Project ID or project name + * @param {number} definitionId - Id of the definition. */ - getAgentClouds() { + getReleaseDefinitionHistory(project, definitionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + definitionId: definitionId + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "bfa72b3d-0fc6-43fb-932b-a7f6559f93b9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "Release", "258b82e0-9d41-43f3-86d6-fef14ddd44bc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseDefinitionRevision, true); resolve(ret); } catch (err) { @@ -21039,22 +22630,23 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskAgentCloud} updatedCloud - * @param {number} agentCloudId + * @param {string} project - Project ID or project name + * @param {number} releaseId */ - updateAgentCloud(updatedCloud, agentCloudId) { + getSummaryMailSections(project, releaseId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - agentCloudId: agentCloudId + project: project, + releaseId: releaseId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "bfa72b3d-0fc6-43fb-932b-a7f6559f93b9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "224e92b2-8d13-4c14-b120-13d877c516f8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, updatedCloud, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.SummaryMailSection, true); resolve(ret); } catch (err) { @@ -21064,20 +22656,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get agent cloud types. - * + * @param {ReleaseInterfaces.MailMessage} mailMessage + * @param {string} project - Project ID or project name + * @param {number} releaseId */ - getAgentCloudTypes() { + sendSummaryMail(mailMessage, project, releaseId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + releaseId: releaseId + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "5932e193-f376-469d-9c3e-e5588ce12cb5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "224e92b2-8d13-4c14-b120-13d877c516f8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentCloudType, true); + res = yield this.rest.create(url, mailMessage, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -21088,31 +22684,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { } /** * @param {string} project - Project ID or project name - * @param {number} queueId - * @param {number} top - * @param {string} continuationToken + * @param {number} definitionId */ - getAgentRequestsForQueue(project, queueId, top, continuationToken) { + getSourceBranches(project, definitionId) { return __awaiter(this, void 0, void 0, function* () { - if (top == null) { - throw new TypeError('top can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - queueId: queueId - }; - let queryValues = { - '$top': top, - continuationToken: continuationToken, + definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "f5f81ffb-f396-498d-85b1-5ada145e648a", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "0e5def23-78b3-461f-8198-1558f25041c8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21122,24 +22709,27 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskAgentJobRequest} request + * Adds a tag to a definition + * * @param {string} project - Project ID or project name - * @param {number} queueId + * @param {number} releaseDefinitionId + * @param {string} tag */ - queueAgentRequest(request, project, queueId) { + addDefinitionTag(project, releaseDefinitionId, tag) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - queueId: queueId + releaseDefinitionId: releaseDefinitionId, + tag: tag }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "f5f81ffb-f396-498d-85b1-5ada145e648a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "3d21b4c8-c32e-45b2-a7cb-770a369012f4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, request, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, false); + res = yield this.rest.update(url, null, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21149,24 +22739,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Adds an agent to a pool. You probably don't want to call this endpoint directly. Instead, [configure an agent](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) using the agent download package. + * Adds multiple tags to a definition * - * @param {TaskAgentInterfaces.TaskAgent} agent - Details about the agent being added - * @param {number} poolId - The agent pool in which to add the agent + * @param {string[]} tags + * @param {string} project - Project ID or project name + * @param {number} releaseDefinitionId */ - addAgent(agent, poolId) { + addDefinitionTags(tags, project, releaseDefinitionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId + project: project, + releaseDefinitionId: releaseDefinitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "3d21b4c8-c32e-45b2-a7cb-770a369012f4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, agent, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); + res = yield this.rest.create(url, tags, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21176,25 +22768,27 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Delete an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove an agent from your organization. + * Deletes a tag from a definition * - * @param {number} poolId - The pool ID to remove the agent from - * @param {number} agentId - The agent ID to remove + * @param {string} project - Project ID or project name + * @param {number} releaseDefinitionId + * @param {string} tag */ - deleteAgent(poolId, agentId) { + deleteDefinitionTag(project, releaseDefinitionId, tag) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - agentId: agentId + project: project, + releaseDefinitionId: releaseDefinitionId, + tag: tag }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "3d21b4c8-c32e-45b2-a7cb-770a369012f4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21204,35 +22798,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get information about an agent. + * Gets the tags for a definition * - * @param {number} poolId - The agent pool containing the agent - * @param {number} agentId - The agent ID to get information about - * @param {boolean} includeCapabilities - Whether to include the agent's capabilities in the response - * @param {boolean} includeAssignedRequest - Whether to include details about the agent's current work - * @param {boolean} includeLastCompletedRequest - Whether to include details about the agents' most recent completed work - * @param {string[]} propertyFilters - Filter which custom properties will be returned + * @param {string} project - Project ID or project name + * @param {number} releaseDefinitionId */ - getAgent(poolId, agentId, includeCapabilities, includeAssignedRequest, includeLastCompletedRequest, propertyFilters) { + getDefinitionTags(project, releaseDefinitionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - agentId: agentId - }; - let queryValues = { - includeCapabilities: includeCapabilities, - includeAssignedRequest: includeAssignedRequest, - includeLastCompletedRequest: includeLastCompletedRequest, - propertyFilters: propertyFilters && propertyFilters.join(","), + project: project, + releaseDefinitionId: releaseDefinitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "3d21b4c8-c32e-45b2-a7cb-770a369012f4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21242,37 +22826,27 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of agents. + * Adds a tag to a releaseId * - * @param {number} poolId - The agent pool containing the agents - * @param {string} agentName - Filter on agent name - * @param {boolean} includeCapabilities - Whether to include the agents' capabilities in the response - * @param {boolean} includeAssignedRequest - Whether to include details about the agents' current work - * @param {boolean} includeLastCompletedRequest - Whether to include details about the agents' most recent completed work - * @param {string[]} propertyFilters - Filter which custom properties will be returned - * @param {string[]} demands - Filter by demands the agents can satisfy + * @param {string} project - Project ID or project name + * @param {number} releaseId + * @param {string} tag */ - getAgents(poolId, agentName, includeCapabilities, includeAssignedRequest, includeLastCompletedRequest, propertyFilters, demands) { + addReleaseTag(project, releaseId, tag) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId - }; - let queryValues = { - agentName: agentName, - includeCapabilities: includeCapabilities, - includeAssignedRequest: includeAssignedRequest, - includeLastCompletedRequest: includeLastCompletedRequest, - propertyFilters: propertyFilters && propertyFilters.join(","), - demands: demands && demands.join(","), + project: project, + releaseId: releaseId, + tag: tag }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "c5b602b6-d1b3-4363-8a51-94384f78068f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, true); + res = yield this.rest.update(url, null, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21282,26 +22856,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Replace an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove and reconfigure an agent from your organization. + * Adds tag to a release * - * @param {TaskAgentInterfaces.TaskAgent} agent - Updated details about the replacing agent - * @param {number} poolId - The agent pool to use - * @param {number} agentId - The agent to replace + * @param {string[]} tags + * @param {string} project - Project ID or project name + * @param {number} releaseId */ - replaceAgent(agent, poolId, agentId) { + addReleaseTags(tags, project, releaseId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - agentId: agentId + project: project, + releaseId: releaseId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "c5b602b6-d1b3-4363-8a51-94384f78068f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, agent, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); + res = yield this.rest.create(url, tags, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21311,72 +22885,27 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Update agent details. + * Deletes a tag from a release * - * @param {TaskAgentInterfaces.TaskAgent} agent - Updated details about the agent - * @param {number} poolId - The agent pool to use - * @param {number} agentId - The agent to update + * @param {string} project - Project ID or project name + * @param {number} releaseId + * @param {string} tag */ - updateAgent(agent, poolId, agentId) { + deleteReleaseTag(project, releaseId, tag) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - agentId: agentId + project: project, + releaseId: releaseId, + tag: tag }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.update(url, agent, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); - }); - } - /** - * Returns list of azure subscriptions - * - */ - getAzureManagementGroups() { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "39fe3bf2-7ee0-4198-a469-4a29929afa9c", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); - }); - } - /** - * Returns list of azure subscriptions - * - */ - getAzureSubscriptions() { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "bcd6189c-0303-471f-a8e1-acb22b74d700", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "c5b602b6-d1b3-4363-8a51-94384f78068f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21386,25 +22915,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * GET a PAT token for managing (configuring, removing, tagging) deployment targets in a deployment group. + * Gets the tags for a release * * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group in which deployment targets are managed. + * @param {number} releaseId */ - generateDeploymentGroupAccessToken(project, deploymentGroupId) { + getReleaseTags(project, releaseId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - deploymentGroupId: deploymentGroupId + releaseId: releaseId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "3d197ba2-c3e9-4253-882f-0ee2440f8174", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "c5b602b6-d1b3-4363-8a51-94384f78068f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21414,24 +22943,21 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Create a deployment group. - * - * @param {TaskAgentInterfaces.DeploymentGroupCreateParameter} deploymentGroup - Deployment group to create. * @param {string} project - Project ID or project name */ - addDeploymentGroup(deploymentGroup, project) { + getTags(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "083c4d89-ab35-45af-aa11-7cf66895c53e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "86cee25a-68ba-4ba3-9171-8ad6ffc6df93", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, deploymentGroup, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentGroup, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21441,25 +22967,27 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Delete a deployment group. - * * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group to be deleted. + * @param {number} releaseId + * @param {number} environmentId + * @param {number} releaseDeployPhaseId */ - deleteDeploymentGroup(project, deploymentGroupId) { + getTasksForTaskGroup(project, releaseId, environmentId, releaseDeployPhaseId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - deploymentGroupId: deploymentGroupId + releaseId: releaseId, + environmentId: environmentId, + releaseDeployPhaseId: releaseDeployPhaseId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "083c4d89-ab35-45af-aa11-7cf66895c53e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "4259191d-4b0a-4409-9fb3-09f22ab9bc47", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseTask, true); resolve(ret); } catch (err) { @@ -21469,31 +22997,29 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a deployment group by its ID. - * * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group. - * @param {TaskAgentInterfaces.DeploymentGroupActionFilter} actionFilter - Get the deployment group only if this action can be performed on it. - * @param {TaskAgentInterfaces.DeploymentGroupExpands} expand - Include these additional details in the returned object. + * @param {number} releaseId + * @param {number} environmentId + * @param {number} attemptId + * @param {string} timelineId */ - getDeploymentGroup(project, deploymentGroupId, actionFilter, expand) { + getTasks2(project, releaseId, environmentId, attemptId, timelineId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - deploymentGroupId: deploymentGroupId - }; - let queryValues = { - actionFilter: actionFilter, - '$expand': expand, + releaseId: releaseId, + environmentId: environmentId, + attemptId: attemptId, + timelineId: timelineId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "083c4d89-ab35-45af-aa11-7cf66895c53e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "4259291d-4b0a-4409-9fb3-04f22ab9bc47", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentGroup, false); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseTask, true); resolve(ret); } catch (err) { @@ -21503,37 +23029,29 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of deployment groups by name or IDs. - * * @param {string} project - Project ID or project name - * @param {string} name - Name of the deployment group. - * @param {TaskAgentInterfaces.DeploymentGroupActionFilter} actionFilter - Get only deployment groups on which this action can be performed. - * @param {TaskAgentInterfaces.DeploymentGroupExpands} expand - Include these additional details in the returned objects. - * @param {string} continuationToken - Get deployment groups with names greater than this continuationToken lexicographically. - * @param {number} top - Maximum number of deployment groups to return. Default is **1000**. - * @param {number[]} ids - Comma separated list of IDs of the deployment groups. + * @param {number} releaseId + * @param {number} environmentId + * @param {number} attemptId */ - getDeploymentGroups(project, name, actionFilter, expand, continuationToken, top, ids) { + getTasks(project, releaseId, environmentId, attemptId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + releaseId: releaseId, + environmentId: environmentId }; let queryValues = { - name: name, - actionFilter: actionFilter, - '$expand': expand, - continuationToken: continuationToken, - '$top': top, - ids: ids && ids.join(","), + attemptId: attemptId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "083c4d89-ab35-45af-aa11-7cf66895c53e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Release", "36b276e0-3c70-4320-a63c-1a2e1466a0d1", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentGroup, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ReleaseTask, true); resolve(ret); } catch (err) { @@ -21543,26 +23061,21 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Update a deployment group. - * - * @param {TaskAgentInterfaces.DeploymentGroupUpdateParameter} deploymentGroup - Deployment group to update. * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group. */ - updateDeploymentGroup(deploymentGroup, project, deploymentGroupId) { + getArtifactTypeDefinitions(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "083c4d89-ab35-45af-aa11-7cf66895c53e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "8efc2a3c-1fc8-4f6d-9822-75e98cecb48f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, deploymentGroup, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentGroup, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ArtifactTypeDefinition, true); resolve(ret); } catch (err) { @@ -21572,31 +23085,28 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of deployment group metrics. - * * @param {string} project - Project ID or project name - * @param {string} deploymentGroupName - Name of the deployment group. - * @param {string} continuationToken - Get metrics for deployment groups with names greater than this continuationToken lexicographically. - * @param {number} top - Maximum number of deployment group metrics to return. Default is **50**. + * @param {number} releaseDefinitionId */ - getDeploymentGroupsMetrics(project, deploymentGroupName, continuationToken, top) { + getArtifactVersions(project, releaseDefinitionId) { return __awaiter(this, void 0, void 0, function* () { + if (releaseDefinitionId == null) { + throw new TypeError('releaseDefinitionId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; let queryValues = { - deploymentGroupName: deploymentGroupName, - continuationToken: continuationToken, - '$top': top, + releaseDefinitionId: releaseDefinitionId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "281c6308-427a-49e1-b83a-dac0f4862189", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "30fc787e-a9e0-4a07-9fbc-3e903aa051d2", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentGroupMetrics, true); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ArtifactVersionQueryResult, false); resolve(ret); } catch (err) { @@ -21606,32 +23116,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * @param {ReleaseInterfaces.Artifact[]} artifacts * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - * @param {number} machineId - * @param {number} completedRequestCount */ - getAgentRequestsForDeploymentMachine(project, deploymentGroupId, machineId, completedRequestCount) { + getArtifactVersionsForSources(artifacts, project) { return __awaiter(this, void 0, void 0, function* () { - if (machineId == null) { - throw new TypeError('machineId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId - }; - let queryValues = { - machineId: machineId, - completedRequestCount: completedRequestCount, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "a3540e5b-f0dc-4668-963b-b752459be545", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "30fc787e-a9e0-4a07-9fbc-3e903aa051d2", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); + res = yield this.rest.create(url, artifacts, options); + let ret = this.formatResponse(res.result, ReleaseInterfaces.TypeInfo.ArtifactVersionQueryResult, false); resolve(ret); } catch (err) { @@ -21642,28 +23142,30 @@ class TaskAgentApiBase extends basem.ClientApiBase { } /** * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - * @param {number[]} machineIds - * @param {number} completedRequestCount + * @param {number} releaseId + * @param {number} baseReleaseId + * @param {number} top + * @param {string} artifactAlias */ - getAgentRequestsForDeploymentMachines(project, deploymentGroupId, machineIds, completedRequestCount) { + getReleaseWorkItemsRefs(project, releaseId, baseReleaseId, top, artifactAlias) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - deploymentGroupId: deploymentGroupId + releaseId: releaseId }; let queryValues = { - machineIds: machineIds && machineIds.join(","), - completedRequestCount: completedRequestCount, + baseReleaseId: baseReleaseId, + '$top': top, + artifactAlias: artifactAlias, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "a3540e5b-f0dc-4668-963b-b752459be545", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Release", "4f165cc0-875c-4768-b148-f12f78769fab", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21672,24 +23174,62 @@ class TaskAgentApiBase extends basem.ClientApiBase { })); }); } +} +exports.ReleaseApi = ReleaseApi; +ReleaseApi.RESOURCE_AREA_ID = "efc2f575-36ef-48e9-b672-0c6fb4a48ac5"; + + +/***/ }), + +/***/ 806: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SecurityRolesApi = void 0; +const basem = __nccwpck_require__(273); +const SecurityRolesInterfaces = __nccwpck_require__(6573); +class SecurityRolesApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-SecurityRoles-api', options); + } /** - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId + * @param {string} scopeId + * @param {string} resourceId */ - refreshDeploymentMachines(project, deploymentGroupId) { + getRoleAssignments(scopeId, resourceId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId + scopeId: scopeId, + resourceId: resourceId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "91006ac4-0f68-4d82-a2bc-540676bd73ce", routeValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "9461c234-c84c-4ed2-b918-2f0f92ad0a35", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, SecurityRolesInterfaces.TypeInfo.RoleAssignment, true); resolve(ret); } catch (err) { @@ -21699,22 +23239,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * GET a PAT token for managing (configuring, removing, tagging) deployment agents in a deployment pool. - * - * @param {number} poolId - ID of the deployment pool in which deployment agents are managed. + * @param {string} scopeId + * @param {string} resourceId + * @param {string} identityId */ - generateDeploymentPoolAccessToken(poolId) { + removeRoleAssignment(scopeId, resourceId, identityId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId + scopeId: scopeId, + resourceId: resourceId, + identityId: identityId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "e077ee4a-399b-420b-841f-c43fbc058e0b", routeValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "9461c234-c84c-4ed2-b918-2f0f92ad0a35", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -21725,28 +23267,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of deployment pool summaries. - * - * @param {string} poolName - Name of the deployment pool. - * @param {TaskAgentInterfaces.DeploymentPoolSummaryExpands} expands - Include these additional details in the returned objects. - * @param {number[]} poolIds - List of deployment pool ids. + * @param {string[]} identityIds + * @param {string} scopeId + * @param {string} resourceId */ - getDeploymentPoolsSummary(poolName, expands, poolIds) { + removeRoleAssignments(identityIds, scopeId, resourceId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - poolName: poolName, - expands: expands, - poolIds: poolIds && poolIds.join(","), + let routeValues = { + scopeId: scopeId, + resourceId: resourceId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6525d6c6-258f-40e0-a1a9-8a24a3957625", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "9461c234-c84c-4ed2-b918-2f0f92ad0a35", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentPoolSummary, true); + res = yield this.rest.update(url, identityIds, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -21756,34 +23294,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get agent requests for a deployment target. - * - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group to which the target belongs. - * @param {number} targetId - ID of the deployment target. - * @param {number} completedRequestCount - Maximum number of completed requests to return. Default is **50** + * @param {SecurityRolesInterfaces.UserRoleAssignmentRef} roleAssignment + * @param {string} scopeId + * @param {string} resourceId + * @param {string} identityId */ - getAgentRequestsForDeploymentTarget(project, deploymentGroupId, targetId, completedRequestCount) { + setRoleAssignment(roleAssignment, scopeId, resourceId, identityId) { return __awaiter(this, void 0, void 0, function* () { - if (targetId == null) { - throw new TypeError('targetId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId - }; - let queryValues = { - targetId: targetId, - completedRequestCount: completedRequestCount, + scopeId: scopeId, + resourceId: resourceId, + identityId: identityId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "2fac0be3-8c8f-4473-ab93-c1389b08a2c9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "9461c234-c84c-4ed2-b918-2f0f92ad0a35", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); + res = yield this.rest.replace(url, roleAssignment, options); + let ret = this.formatResponse(res.result, SecurityRolesInterfaces.TypeInfo.RoleAssignment, false); resolve(ret); } catch (err) { @@ -21793,35 +23323,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get agent requests for a list deployment targets. - * - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group to which the targets belong. - * @param {number[]} targetIds - Comma separated list of IDs of the deployment targets. - * @param {number} ownerId - Id of owner of agent job request. - * @param {Date} completedOn - Datetime to return request after this time. - * @param {number} completedRequestCount - Maximum number of completed requests to return for each target. Default is **50** + * @param {SecurityRolesInterfaces.UserRoleAssignmentRef[]} roleAssignments + * @param {string} scopeId + * @param {string} resourceId */ - getAgentRequestsForDeploymentTargets(project, deploymentGroupId, targetIds, ownerId, completedOn, completedRequestCount) { + setRoleAssignments(roleAssignments, scopeId, resourceId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId - }; - let queryValues = { - targetIds: targetIds && targetIds.join(","), - ownerId: ownerId, - completedOn: completedOn, - completedRequestCount: completedRequestCount, + scopeId: scopeId, + resourceId: resourceId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "2fac0be3-8c8f-4473-ab93-c1389b08a2c9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "9461c234-c84c-4ed2-b918-2f0f92ad0a35", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); + res = yield this.rest.replace(url, roleAssignments, options); + let ret = this.formatResponse(res.result, SecurityRolesInterfaces.TypeInfo.RoleAssignment, true); resolve(ret); } catch (err) { @@ -21831,25 +23350,21 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Upgrade the deployment targets in a deployment group. - * - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group. + * @param {string} scopeId */ - refreshDeploymentTargets(project, deploymentGroupId) { + getRoleDefinitions(scopeId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId + scopeId: scopeId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "1c1a817f-f23d-41c6-bf8d-14b638f64152", routeValues); + let verData = yield this.vsoClient.getVersioningData("3.2-preview.1", "securityroles", "f4cc9a86-453c-48d2-b44d-d3bd5c105f4f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -21858,178 +23373,454 @@ class TaskAgentApiBase extends basem.ClientApiBase { })); }); } +} +exports.SecurityRolesApi = SecurityRolesApi; + + +/***/ }), + +/***/ 5817: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ContractSerializer = void 0; +/** +* Module for handling serialization and deserialization of data contracts +* (contracts sent from the server using the VSO default REST api serialization settings) +*/ +var ContractSerializer; +(function (ContractSerializer) { + var _legacyDateRegExp; /** - * Proxy for a GET request defined by an 'endpoint'. The request is authorized using a service connection. The response is filtered using an XPath/Json based selector. + * Process a contract in its raw form (e.g. date fields are Dates, and Enums are numbers) and + * return a pure JSON object that can be posted to REST endpoint. * - * @param {TaskAgentInterfaces.TaskDefinitionEndpoint} endpoint - Describes the URL to fetch. + * @param data The object to serialize + * @param contractMetadata The type info/metadata for the contract type being serialized + * @param preserveOriginal If true, don't modify the original object. False modifies the original object (the return value points to the data argument). */ - queryEndpoint(endpoint) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "f223b809-8c33-4b7d-b53f-07232569b5d6", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, endpoint, options); - let ret = this.formatResponse(res.result, null, true); - resolve(ret); + function serialize(data, contractMetadata, preserveOriginal) { + if (data && contractMetadata) { + if (Array.isArray(data)) { + return _getTranslatedArray(data, contractMetadata, true, preserveOriginal); + } + else { + return _getTranslatedObject(data, contractMetadata, true, preserveOriginal); + } + } + else { + return data; + } + } + ContractSerializer.serialize = serialize; + /** + * Process a pure JSON object (e.g. that came from a REST call) and transform it into a JS object + * where date strings are converted to Date objects and enum values are converted from strings into + * their numerical value. + * + * @param data The object to deserialize + * @param contractMetadata The type info/metadata for the contract type being deserialize + * @param preserveOriginal If true, don't modify the original object. False modifies the original object (the return value points to the data argument). + * @param unwrapWrappedCollections If true check for wrapped arrays (REST apis will not return arrays directly as the root result but will instead wrap them in a { values: [], count: 0 } object. + */ + function deserialize(data, contractMetadata, preserveOriginal, unwrapWrappedCollections) { + if (data) { + if (unwrapWrappedCollections && Array.isArray(data.value)) { + // Wrapped json array - unwrap it and send the array as the result + data = data.value; + } + if (contractMetadata) { + if (Array.isArray(data)) { + data = _getTranslatedArray(data, contractMetadata, false, preserveOriginal); } - catch (err) { - reject(err); + else { + data = _getTranslatedObject(data, contractMetadata, false, preserveOriginal); } - })); - }); + } + } + return data; + } + ContractSerializer.deserialize = deserialize; + function _getTranslatedArray(array, typeMetadata, serialize, preserveOriginal) { + var resultArray = array; + var arrayCopy = []; + var i; + for (i = 0; i < array.length; i++) { + var item = array[i]; + var processedItem; + // handle arrays of arrays + if (Array.isArray(item)) { + processedItem = _getTranslatedArray(item, typeMetadata, serialize, preserveOriginal); + } + else { + processedItem = _getTranslatedObject(item, typeMetadata, serialize, preserveOriginal); + } + if (preserveOriginal) { + arrayCopy.push(processedItem); + if (processedItem !== item) { + resultArray = arrayCopy; + } + } + else { + array[i] = processedItem; + } + } + return resultArray; + } + function _getTranslatedObject(typeObject, typeMetadata, serialize, preserveOriginal) { + var processedItem = typeObject, copiedItem = false; + if (typeObject && typeMetadata.fields) { + for (var fieldName in typeMetadata.fields) { + var fieldMetadata = typeMetadata.fields[fieldName]; + var fieldValue = typeObject[fieldName]; + var translatedValue = _getTranslatedField(fieldValue, fieldMetadata, serialize, preserveOriginal); + if (fieldValue !== translatedValue) { + if (preserveOriginal && !copiedItem) { + processedItem = this._extend({}, typeObject); + copiedItem = true; + } + processedItem[fieldName] = translatedValue; + } + } + } + return processedItem; + } + function _getTranslatedField(fieldValue, fieldMetadata, serialize, preserveOriginal) { + if (!fieldValue) { + return fieldValue; + } + if (fieldMetadata.isArray) { + if (Array.isArray(fieldValue)) { + var newArray = [], processedArray = fieldValue; + for (var index = 0; index < fieldValue.length; index++) { + var arrayValue = fieldValue[index]; + var processedValue = arrayValue; + if (fieldMetadata.isDate) { + processedValue = _getTranslatedDateValue(arrayValue, serialize); + } + else if (fieldMetadata.enumType) { + processedValue = _getTranslatedEnumValue(fieldMetadata.enumType, arrayValue, serialize); + } + else if (fieldMetadata.typeInfo) { + if (Array.isArray(arrayValue)) { + processedValue = _getTranslatedArray(arrayValue, fieldMetadata.typeInfo, serialize, preserveOriginal); + } + else { + processedValue = _getTranslatedObject(arrayValue, fieldMetadata.typeInfo, serialize, preserveOriginal); + } + } + if (preserveOriginal) { + newArray.push(processedValue); + if (processedValue !== arrayValue) { + processedArray = newArray; + } + } + else { + fieldValue[index] = processedValue; + } + } + return processedArray; + } + else { + return fieldValue; + } + } + else if (fieldMetadata.isDictionary) { + var dictionaryModified = false; + var newDictionary = {}; + for (var key in fieldValue) { + var dictionaryValue = fieldValue[key]; + var newKey = key, newValue = dictionaryValue; + if (fieldMetadata.dictionaryKeyIsDate) { + newKey = _getTranslatedDateValue(key, serialize); + } + else if (fieldMetadata.dictionaryKeyEnumType) { + newKey = _getTranslatedEnumValue(fieldMetadata.dictionaryKeyEnumType, key, serialize); + } + if (fieldMetadata.dictionaryValueIsDate) { + newValue = _getTranslatedDateValue(dictionaryValue, serialize); + } + else if (fieldMetadata.dictionaryValueEnumType) { + newValue = _getTranslatedEnumValue(fieldMetadata.dictionaryValueEnumType, dictionaryValue, serialize); + } + else if (fieldMetadata.dictionaryValueTypeInfo) { + newValue = _getTranslatedObject(newValue, fieldMetadata.dictionaryValueTypeInfo, serialize, preserveOriginal); + } + else if (fieldMetadata.dictionaryValueFieldInfo) { + newValue = _getTranslatedField(dictionaryValue, fieldMetadata.dictionaryValueFieldInfo, serialize, preserveOriginal); + } + newDictionary[newKey] = newValue; + if (key !== newKey || dictionaryValue !== newValue) { + dictionaryModified = true; + } + } + return dictionaryModified ? newDictionary : fieldValue; + } + else { + if (fieldMetadata.isDate) { + return _getTranslatedDateValue(fieldValue, serialize); + } + else if (fieldMetadata.enumType) { + return _getTranslatedEnumValue(fieldMetadata.enumType, fieldValue, serialize); + } + else if (fieldMetadata.typeInfo) { + return _getTranslatedObject(fieldValue, fieldMetadata.typeInfo, serialize, preserveOriginal); + } + else { + return fieldValue; + } + } + } + function _getTranslatedEnumValue(enumType, valueToConvert, serialize) { + if (serialize && typeof valueToConvert === "number") { + // Serialize: number --> String + // Because webapi handles the numerical value for enums, there is no need to convert to string. + // Let this fall through to return the numerical value. + } + else if (!serialize && typeof valueToConvert === "string") { + // Deserialize: String --> number + var result = 0; + if (valueToConvert) { + var splitValue = valueToConvert.split(","); + for (var i = 0; i < splitValue.length; i++) { + var valuePart = splitValue[i]; + //equivalent to jquery trim + //copied from https://github.com/HubSpot/youmightnotneedjquery/blob/ef987223c20e480fcbfb5924d96c11cd928e1226/comparisons/utils/trim/ie8.js + var enumName = valuePart.replace(/^\s+|\s+$/g, '') || ""; + if (enumName) { + var resultPart = enumType.enumValues[enumName]; + if (!resultPart) { + // No matching enum value. Try again but case insensitive + var lowerCaseEnumName = enumName.toLowerCase(); + if (lowerCaseEnumName !== enumName) { + for (var name in enumType.enumValues) { + var value = enumType.enumValues[name]; + if (name.toLowerCase() === lowerCaseEnumName) { + resultPart = value; + break; + } + } + } + } + if (resultPart) { + result |= resultPart; + } + } + } + } + return result; + } + return valueToConvert; + } + function _getTranslatedDateValue(valueToConvert, serialize) { + if (!serialize && typeof valueToConvert === "string") { + // Deserialize: String --> Date + var dateValue = new Date(valueToConvert); + if (isNaN(dateValue) && navigator.userAgent && /msie/i.test(navigator.userAgent)) { + dateValue = _convertLegacyIEDate(valueToConvert); + } + return dateValue; + } + return valueToConvert; + } + function _convertLegacyIEDate(dateStringValue) { + // IE 8/9 does not handle parsing dates in ISO form like: + // 2013-05-13T14:26:54.397Z + var match; + if (!_legacyDateRegExp) { + _legacyDateRegExp = new RegExp("(\\d+)-(\\d+)-(\\d+)T(\\d+):(\\d+):(\\d+).(\\d+)Z"); + } + match = _legacyDateRegExp.exec(dateStringValue); + if (match) { + return new Date(Date.UTC(parseInt(match[1]), parseInt(match[2]) - 1, parseInt(match[3]), parseInt(match[4]), parseInt(match[5]), parseInt(match[6]), parseInt(match[7]))); + } + else { + return null; + } + } + // jquery extend method in native javascript (used to clone objects) + // copied from https://github.com/HubSpot/youmightnotneedjquery/blob/ef987223c20e480fcbfb5924d96c11cd928e1226/comparisons/utils/extend/ie8.js + var _extend = function (out) { + out = out || {}; + for (var i = 1; i < arguments.length; i++) { + if (!arguments[i]) + continue; + for (var key in arguments[i]) { + if (arguments[i].hasOwnProperty(key)) + out[key] = arguments[i][key]; + } + } + return out; + }; +})(ContractSerializer = exports.ContractSerializer || (exports.ContractSerializer = {})); + + +/***/ }), + +/***/ 5899: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TaskAgentApi = void 0; +const taskagentbasem = __nccwpck_require__(3390); +const url = __nccwpck_require__(7310); +class TaskAgentApi extends taskagentbasem.TaskAgentApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, options, userAgent); + // hang on to the handlers in case we need to fall back to an account-level client + this._handlers = handlers; + this._options = options; } /** - * Get environment deployment execution history - * - * @param {string} project - Project ID or project name - * @param {number} environmentId - * @param {string} continuationToken - * @param {number} top + * @param {string} taskId + * @param onResult callback function */ - getEnvironmentDeploymentExecutionRecords(project, environmentId, continuationToken, top) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - environmentId: environmentId - }; - let queryValues = { - continuationToken: continuationToken, - top: top, - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "51bb5d21-4305-4ea6-9dbb-b7488af73334", routeValues, queryValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.EnvironmentDeploymentExecutionRecord, true); - resolve(ret); + deleteTaskDefinition(taskId) { + let promise = this.vsoClient.beginGetLocation("distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd") + .then((location) => { + if (location) { + // the resource exists at the url we were given. go! + return super.deleteTaskDefinition(taskId); + } + else { + // this is the case when the server doesn't support collection-level task definitions + var fallbackClient = this._getFallbackClient(this.baseUrl); + if (!fallbackClient) { + // couldn't convert + throw new Error("Failed to find api location for area: distributedtask id: 60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd"); } - catch (err) { - reject(err); + else { + // use the fallback client + return fallbackClient.deleteTaskDefinition(taskId); } - })); + } }); + return promise; } /** - * Create an environment. - * - * @param {TaskAgentInterfaces.EnvironmentCreateParameter} environmentCreateParameter - Environment to create. - * @param {string} project - Project ID or project name + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @param onResult callback function with the resulting ArrayBuffer */ - addEnvironment(environmentCreateParameter, project) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "8572b1fc-2482-47fa-8f74-7e3ed53ee54b", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, environmentCreateParameter, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.EnvironmentInstance, false); - resolve(ret); + getTaskContentZip(taskId, versionString, visibility, scopeLocal) { + let promise = this.vsoClient.beginGetLocation("distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd") + .then((location) => { + if (location) { + // the resource exists at the url we were given. go! + return super.getTaskContentZip(taskId, versionString, visibility, scopeLocal); + } + else { + // this is the case when the server doesn't support collection-level task definitions + var fallbackClient = this._getFallbackClient(this.baseUrl); + if (!fallbackClient) { + // couldn't convert + throw new Error("Failed to find api location for area: distributedtask id: 60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd"); } - catch (err) { - reject(err); + else { + // use the fallback client + return fallbackClient.getTaskContentZip(taskId, versionString, visibility, scopeLocal); } - })); + } }); + return promise; } /** - * Delete the specified environment. - * - * @param {string} project - Project ID or project name - * @param {number} environmentId - ID of the environment. + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @param onResult callback function with the resulting TaskAgentInterfaces.TaskDefinition */ - deleteEnvironment(project, environmentId) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - environmentId: environmentId - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "8572b1fc-2482-47fa-8f74-7e3ed53ee54b", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + getTaskDefinition(taskId, versionString, visibility, scopeLocal) { + let promise = this.vsoClient.beginGetLocation("distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd") + .then((location) => { + if (location) { + // the resource exists at the url we were given. go! + return super.getTaskDefinition(taskId, versionString, visibility, scopeLocal); + } + else { + // this is the case when the server doesn't support collection-level task definitions + var fallbackClient = this._getFallbackClient(this.baseUrl); + if (!fallbackClient) { + // couldn't convert + throw new Error("Failed to find api location for area: distributedtask id: 60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd"); } - catch (err) { - reject(err); + else { + // use the fallback client + return fallbackClient.getTaskDefinition(taskId, versionString, visibility, scopeLocal); } - })); + } }); + return promise; } /** - * Get an environment by its ID. - * - * @param {string} project - Project ID or project name - * @param {number} environmentId - ID of the environment. - * @param {TaskAgentInterfaces.EnvironmentExpands} expands - Include these additional details in the returned objects. + * @param {string} taskId + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @param onResult callback function with the resulting TaskAgentInterfaces.TaskDefinition[] */ - getEnvironmentById(project, environmentId, expands) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - environmentId: environmentId - }; - let queryValues = { - expands: expands, - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "8572b1fc-2482-47fa-8f74-7e3ed53ee54b", routeValues, queryValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.EnvironmentInstance, false); - resolve(ret); + getTaskDefinitions(taskId, visibility, scopeLocal) { + let promise = this.vsoClient.beginGetLocation("distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd") + .then((location) => { + if (location) { + // the resource exists at the url we were given. go! + return super.getTaskDefinitions(taskId, visibility, scopeLocal); + } + else { + // this is the case when the server doesn't support collection-level task definitions + var fallbackClient = this._getFallbackClient(this.baseUrl); + if (!fallbackClient) { + // couldn't convert + throw new Error("Failed to find api location for area: distributedtask id: 60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd"); } - catch (err) { - reject(err); + else { + // use the fallback client + return fallbackClient.getTaskDefinitions(taskId, visibility, scopeLocal); } - })); + } }); + return promise; } /** - * Get all environments. - * - * @param {string} project - Project ID or project name - * @param {string} name - * @param {string} continuationToken - * @param {number} top + * @param {NodeJS.ReadableStream} contentStream + * @param {string} taskId + * @param {boolean} overwrite + * @param onResult callback function */ - getEnvironments(project, name, continuationToken, top) { + uploadTaskDefinition(customHeaders, contentStream, taskId, overwrite) { return __awaiter(this, void 0, void 0, function* () { + let routeValues = { + taskId: taskId + }; + let queryValues = { + overwrite: overwrite, + }; return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project - }; - let queryValues = { - name: name, - continuationToken: continuationToken, - '$top': top, - }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "8572b1fc-2482-47fa-8f74-7e3ed53ee54b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("3.0-preview.1", "distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.EnvironmentInstance, true); - resolve(ret); + res = yield this.rest.uploadStream("PUT", url, contentStream, options); + resolve(res.result); } catch (err) { reject(err); @@ -22037,27 +23828,93 @@ class TaskAgentApiBase extends basem.ClientApiBase { })); }); } - /** - * Update the specified environment. - * - * @param {TaskAgentInterfaces.EnvironmentUpdateParameter} environmentUpdateParameter - Environment data to update. - * @param {string} project - Project ID or project name - * @param {number} environmentId - ID of the environment. + _getFallbackClient(baseUrl) { + if (!this._fallbackClient) { + var accountUrl = this._getAccountUrl(baseUrl); + if (accountUrl) { + this._fallbackClient = new TaskAgentApi(accountUrl, this._handlers, this._options); + } + } + return this._fallbackClient; + } + _getAccountUrl(collectionUrl) { + // converts a collection URL to an account URL + // returns null if the conversion can't be made + var purl = url.parse(collectionUrl); + if (!purl.protocol || !purl.host) { + return null; + } + var accountUrl = purl.protocol + '//' + purl.host; + // purl.path is something like /DefaultCollection or /tfs/DefaultCollection or /DefaultCollection/ + var splitPath = purl.path.split('/').slice(1); + if (splitPath.length === 0 || (splitPath.length === 1 && splitPath[0] === '')) { + return null; + } + // if the first segment of the path is tfs, the second is the collection. if the url ends in / there will be a third, empty entry + if (splitPath[0] === 'tfs' && (splitPath.length === 2 || (splitPath.length === 3 && splitPath[2].length === 0))) { + //on prem + accountUrl += '/' + 'tfs'; + } + else if (splitPath.length === 2 && splitPath[0] === '') { + // /DefaultCollection/ + return accountUrl; + } + else if (splitPath.length > 1) { + return null; + } + return accountUrl; + } +} +exports.TaskAgentApi = TaskAgentApi; + + +/***/ }), + +/***/ 3390: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TaskAgentApiBase = void 0; +const basem = __nccwpck_require__(273); +const TaskAgentInterfaces = __nccwpck_require__(9565); +class TaskAgentApiBase extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-TaskAgent-api', options); + } + /** + * @param {TaskAgentInterfaces.TaskAgentCloud} agentCloud */ - updateEnvironment(environmentUpdateParameter, project, environmentId) { + addAgentCloud(agentCloud) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - environmentId: environmentId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "8572b1fc-2482-47fa-8f74-7e3ed53ee54b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "bfa72b3d-0fc6-43fb-932b-a7f6559f93b9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, environmentUpdateParameter, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.EnvironmentInstance, false); + res = yield this.rest.create(url, agentCloud, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -22067,26 +23924,20 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} hubName - * @param {boolean} includeEnterpriseUsersCount - * @param {boolean} includeHostedAgentMinutesCount + * @param {number} agentCloudId */ - getTaskHubLicenseDetails(hubName, includeEnterpriseUsersCount, includeHostedAgentMinutesCount) { + deleteAgentCloud(agentCloudId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - hubName: hubName - }; - let queryValues = { - includeEnterpriseUsersCount: includeEnterpriseUsersCount, - includeHostedAgentMinutesCount: includeHostedAgentMinutesCount, + agentCloudId: agentCloudId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "distributedtask", "f9f0f436-b8a1-4475-9041-1ccdbf8f0128", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "bfa72b3d-0fc6-43fb-932b-a7f6559f93b9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -22097,21 +23948,20 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskHubLicenseDetails} taskHubLicenseDetails - * @param {string} hubName + * @param {number} agentCloudId */ - updateTaskHubLicenseDetails(taskHubLicenseDetails, hubName) { + getAgentCloud(agentCloudId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - hubName: hubName + agentCloudId: agentCloudId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "distributedtask", "f9f0f436-b8a1-4475-9041-1ccdbf8f0128", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "bfa72b3d-0fc6-43fb-932b-a7f6559f93b9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, taskHubLicenseDetails, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -22122,19 +23972,18 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.InputValidationRequest} inputValidationRequest */ - validateInputs(inputValidationRequest) { + getAgentClouds() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "58475b1e-adaf-4155-9bc1-e04bf1fff4c2", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "bfa72b3d-0fc6-43fb-932b-a7f6559f93b9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, inputValidationRequest, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -22144,33 +23993,21 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number} requestId - * @param {string} lockToken - * @param {TaskAgentInterfaces.TaskResult} result - * @param {boolean} agentShuttingDown + * @param {TaskAgentInterfaces.TaskAgentCloud} updatedCloud + * @param {number} agentCloudId */ - deleteAgentRequest(poolId, requestId, lockToken, result, agentShuttingDown) { + updateAgentCloud(updatedCloud, agentCloudId) { return __awaiter(this, void 0, void 0, function* () { - if (lockToken == null) { - throw new TypeError('lockToken can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - requestId: requestId - }; - let queryValues = { - lockToken: lockToken, - result: result, - agentShuttingDown: agentShuttingDown, + agentCloudId: agentCloudId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "bfa72b3d-0fc6-43fb-932b-a7f6559f93b9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.update(url, updatedCloud, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -22181,27 +24018,20 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number} requestId - * @param {boolean} includeStatus + * Get agent cloud types. + * */ - getAgentRequest(poolId, requestId, includeStatus) { + getAgentCloudTypes() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - poolId: poolId, - requestId: requestId - }; - let queryValues = { - includeStatus: includeStatus, - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "5932e193-f376-469d-9c3e-e5588ce12cb5", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentCloudType, true); resolve(ret); } catch (err) { @@ -22211,25 +24041,27 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId + * @param {string} project - Project ID or project name + * @param {number} queueId * @param {number} top * @param {string} continuationToken */ - getAgentRequests(poolId, top, continuationToken) { + getAgentRequestsForQueue(project, queueId, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { if (top == null) { throw new TypeError('top can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId + project: project, + queueId: queueId }; let queryValues = { '$top': top, continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "f5f81ffb-f396-498d-85b1-5ada145e648a", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -22244,30 +24076,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number} agentId - * @param {number} completedRequestCount + * @param {TaskAgentInterfaces.TaskAgentJobRequest} request + * @param {string} project - Project ID or project name + * @param {number} queueId */ - getAgentRequestsForAgent(poolId, agentId, completedRequestCount) { + queueAgentRequest(request, project, queueId) { return __awaiter(this, void 0, void 0, function* () { - if (agentId == null) { - throw new TypeError('agentId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId - }; - let queryValues = { - agentId: agentId, - completedRequestCount: completedRequestCount, + project: project, + queueId: queueId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "f5f81ffb-f396-498d-85b1-5ada145e648a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); + res = yield this.rest.create(url, request, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, false); resolve(ret); } catch (err) { @@ -22277,27 +24103,52 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number[]} agentIds - * @param {number} completedRequestCount + * Adds an agent to a pool. You probably don't want to call this endpoint directly. Instead, [configure an agent](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) using the agent download package. + * + * @param {TaskAgentInterfaces.TaskAgent} agent - Details about the agent being added + * @param {number} poolId - The agent pool in which to add the agent */ - getAgentRequestsForAgents(poolId, agentIds, completedRequestCount) { + addAgent(agent, poolId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { poolId: poolId }; - let queryValues = { - agentIds: agentIds && agentIds.join(","), - completedRequestCount: completedRequestCount, + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, agent, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Delete an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove an agent from your organization. + * + * @param {number} poolId - The pool ID to remove the agent from + * @param {number} agentId - The agent ID to remove + */ + deleteAgent(poolId, agentId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + poolId: poolId, + agentId: agentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -22307,30 +24158,35 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {string} planId - * @param {string} jobId + * Get information about an agent. + * + * @param {number} poolId - The agent pool containing the agent + * @param {number} agentId - The agent ID to get information about + * @param {boolean} includeCapabilities - Whether to include the agent's capabilities in the response + * @param {boolean} includeAssignedRequest - Whether to include details about the agent's current work + * @param {boolean} includeLastCompletedRequest - Whether to include details about the agents' most recent completed work + * @param {string[]} propertyFilters - Filter which custom properties will be returned */ - getAgentRequestsForPlan(poolId, planId, jobId) { + getAgent(poolId, agentId, includeCapabilities, includeAssignedRequest, includeLastCompletedRequest, propertyFilters) { return __awaiter(this, void 0, void 0, function* () { - if (planId == null) { - throw new TypeError('planId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId + poolId: poolId, + agentId: agentId }; let queryValues = { - planId: planId, - jobId: jobId, + includeCapabilities: includeCapabilities, + includeAssignedRequest: includeAssignedRequest, + includeLastCompletedRequest: includeLastCompletedRequest, + propertyFilters: propertyFilters && propertyFilters.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); resolve(ret); } catch (err) { @@ -22340,22 +24196,37 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskAgentJobRequest} request - * @param {number} poolId + * Get a list of agents. + * + * @param {number} poolId - The agent pool containing the agents + * @param {string} agentName - Filter on agent name + * @param {boolean} includeCapabilities - Whether to include the agents' capabilities in the response + * @param {boolean} includeAssignedRequest - Whether to include details about the agents' current work + * @param {boolean} includeLastCompletedRequest - Whether to include details about the agents' most recent completed work + * @param {string[]} propertyFilters - Filter which custom properties will be returned + * @param {string[]} demands - Filter by demands the agents can satisfy */ - queueAgentRequestByPool(request, poolId) { + getAgents(poolId, agentName, includeCapabilities, includeAssignedRequest, includeLastCompletedRequest, propertyFilters, demands) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { poolId: poolId }; + let queryValues = { + agentName: agentName, + includeCapabilities: includeCapabilities, + includeAssignedRequest: includeAssignedRequest, + includeLastCompletedRequest: includeLastCompletedRequest, + propertyFilters: propertyFilters && propertyFilters.join(","), + demands: demands && demands.join(","), + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, request, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, true); resolve(ret); } catch (err) { @@ -22365,33 +24236,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskAgentJobRequest} request - * @param {number} poolId - * @param {number} requestId - * @param {string} lockToken - * @param {TaskAgentInterfaces.TaskAgentRequestUpdateOptions} updateOptions + * Replace an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove and reconfigure an agent from your organization. + * + * @param {TaskAgentInterfaces.TaskAgent} agent - Updated details about the replacing agent + * @param {number} poolId - The agent pool to use + * @param {number} agentId - The agent to replace */ - updateAgentRequest(request, poolId, requestId, lockToken, updateOptions) { + replaceAgent(agent, poolId, agentId) { return __awaiter(this, void 0, void 0, function* () { - if (lockToken == null) { - throw new TypeError('lockToken can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { poolId: poolId, - requestId: requestId - }; - let queryValues = { - lockToken: lockToken, - updateOptions: updateOptions, + agentId: agentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, request, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, false); + res = yield this.rest.replace(url, agent, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); resolve(ret); } catch (err) { @@ -22401,24 +24265,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.KubernetesResourceCreateParameters} createParameters - * @param {string} project - Project ID or project name - * @param {number} environmentId + * Update agent details. + * + * @param {TaskAgentInterfaces.TaskAgent} agent - Updated details about the agent + * @param {number} poolId - The agent pool to use + * @param {number} agentId - The agent to update */ - addKubernetesResource(createParameters, project, environmentId) { + updateAgent(agent, poolId, agentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - environmentId: environmentId + poolId: poolId, + agentId: agentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "73fba52f-15ab-42b3-a538-ce67a9223a04", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "e298ef32-5878-4cab-993c-043836571f42", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, createParameters, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.KubernetesResource, false); + res = yield this.rest.update(url, agent, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); resolve(ret); } catch (err) { @@ -22428,24 +24294,19 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {number} environmentId - * @param {number} resourceId + * Returns list of azure subscriptions + * */ - deleteKubernetesResource(project, environmentId, resourceId) { + getAzureManagementGroups() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - environmentId: environmentId, - resourceId: resourceId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "73fba52f-15ab-42b3-a538-ce67a9223a04", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "39fe3bf2-7ee0-4198-a469-4a29929afa9c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -22456,25 +24317,20 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {number} environmentId - * @param {number} resourceId + * Returns list of azure subscriptions + * */ - getKubernetesResource(project, environmentId, resourceId) { + getAzureSubscriptions() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - environmentId: environmentId, - resourceId: resourceId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "73fba52f-15ab-42b3-a538-ce67a9223a04", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "bcd6189c-0303-471f-a8e1-acb22b74d700", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.KubernetesResource, false); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -22484,18 +24340,20 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * GET a PAT token for managing (configuring, removing, tagging) deployment targets in a deployment group. + * * @param {string} project - Project ID or project name - * @param {number} machineGroupId + * @param {number} deploymentGroupId - ID of the deployment group in which deployment targets are managed. */ - generateDeploymentMachineGroupAccessToken(project, machineGroupId) { + generateDeploymentGroupAccessToken(project, deploymentGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - machineGroupId: machineGroupId + deploymentGroupId: deploymentGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "f8c7c0de-ac0d-469b-9cb1-c21f72d67693", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "3d197ba2-c3e9-4253-882f-0ee2440f8174", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -22510,22 +24368,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.DeploymentMachineGroup} machineGroup + * Create a deployment group. + * + * @param {TaskAgentInterfaces.DeploymentGroupCreateParameter} deploymentGroup - Deployment group to create. * @param {string} project - Project ID or project name */ - addDeploymentMachineGroup(machineGroup, project) { + addDeploymentGroup(deploymentGroup, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "d4adf50f-80c6-4ac8-9ca1-6e4e544286e9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "083c4d89-ab35-45af-aa11-7cf66895c53e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, machineGroup, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachineGroup, false); + res = yield this.rest.create(url, deploymentGroup, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentGroup, false); resolve(ret); } catch (err) { @@ -22535,18 +24395,20 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * Delete a deployment group. + * * @param {string} project - Project ID or project name - * @param {number} machineGroupId + * @param {number} deploymentGroupId - ID of the deployment group to be deleted. */ - deleteDeploymentMachineGroup(project, machineGroupId) { + deleteDeploymentGroup(project, deploymentGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - machineGroupId: machineGroupId + deploymentGroupId: deploymentGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "d4adf50f-80c6-4ac8-9ca1-6e4e544286e9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "083c4d89-ab35-45af-aa11-7cf66895c53e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -22561,27 +24423,31 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * Get a deployment group by its ID. + * * @param {string} project - Project ID or project name - * @param {number} machineGroupId - * @param {TaskAgentInterfaces.MachineGroupActionFilter} actionFilter + * @param {number} deploymentGroupId - ID of the deployment group. + * @param {TaskAgentInterfaces.DeploymentGroupActionFilter} actionFilter - Get the deployment group only if this action can be performed on it. + * @param {TaskAgentInterfaces.DeploymentGroupExpands} expand - Include these additional details in the returned object. */ - getDeploymentMachineGroup(project, machineGroupId, actionFilter) { + getDeploymentGroup(project, deploymentGroupId, actionFilter, expand) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - machineGroupId: machineGroupId + deploymentGroupId: deploymentGroupId }; let queryValues = { actionFilter: actionFilter, + '$expand': expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "d4adf50f-80c6-4ac8-9ca1-6e4e544286e9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "083c4d89-ab35-45af-aa11-7cf66895c53e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachineGroup, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentGroup, false); resolve(ret); } catch (err) { @@ -22591,27 +24457,37 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * Get a list of deployment groups by name or IDs. + * * @param {string} project - Project ID or project name - * @param {string} machineGroupName - * @param {TaskAgentInterfaces.MachineGroupActionFilter} actionFilter + * @param {string} name - Name of the deployment group. + * @param {TaskAgentInterfaces.DeploymentGroupActionFilter} actionFilter - Get only deployment groups on which this action can be performed. + * @param {TaskAgentInterfaces.DeploymentGroupExpands} expand - Include these additional details in the returned objects. + * @param {string} continuationToken - Get deployment groups with names greater than this continuationToken lexicographically. + * @param {number} top - Maximum number of deployment groups to return. Default is **1000**. + * @param {number[]} ids - Comma separated list of IDs of the deployment groups. */ - getDeploymentMachineGroups(project, machineGroupName, actionFilter) { + getDeploymentGroups(project, name, actionFilter, expand, continuationToken, top, ids) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; let queryValues = { - machineGroupName: machineGroupName, + name: name, actionFilter: actionFilter, + '$expand': expand, + continuationToken: continuationToken, + '$top': top, + ids: ids && ids.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "d4adf50f-80c6-4ac8-9ca1-6e4e544286e9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "083c4d89-ab35-45af-aa11-7cf66895c53e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachineGroup, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentGroup, true); resolve(ret); } catch (err) { @@ -22621,24 +24497,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.DeploymentMachineGroup} machineGroup + * Update a deployment group. + * + * @param {TaskAgentInterfaces.DeploymentGroupUpdateParameter} deploymentGroup - Deployment group to update. * @param {string} project - Project ID or project name - * @param {number} machineGroupId + * @param {number} deploymentGroupId - ID of the deployment group. */ - updateDeploymentMachineGroup(machineGroup, project, machineGroupId) { + updateDeploymentGroup(deploymentGroup, project, deploymentGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - machineGroupId: machineGroupId + deploymentGroupId: deploymentGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "d4adf50f-80c6-4ac8-9ca1-6e4e544286e9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "083c4d89-ab35-45af-aa11-7cf66895c53e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, machineGroup, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachineGroup, false); + res = yield this.rest.update(url, deploymentGroup, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentGroup, false); resolve(ret); } catch (err) { @@ -22648,27 +24526,31 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * Get a list of deployment group metrics. + * * @param {string} project - Project ID or project name - * @param {number} machineGroupId - * @param {string[]} tagFilters + * @param {string} deploymentGroupName - Name of the deployment group. + * @param {string} continuationToken - Get metrics for deployment groups with names greater than this continuationToken lexicographically. + * @param {number} top - Maximum number of deployment group metrics to return. Default is **50**. */ - getDeploymentMachineGroupMachines(project, machineGroupId, tagFilters) { + getDeploymentGroupsMetrics(project, deploymentGroupName, continuationToken, top) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - machineGroupId: machineGroupId + project: project }; let queryValues = { - tagFilters: tagFilters && tagFilters.join(","), + deploymentGroupName: deploymentGroupName, + continuationToken: continuationToken, + '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "966c3874-c347-4b18-a90c-d509116717fd", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "281c6308-427a-49e1-b83a-dac0f4862189", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentGroupMetrics, true); resolve(ret); } catch (err) { @@ -22678,24 +24560,32 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.DeploymentMachine[]} deploymentMachines * @param {string} project - Project ID or project name - * @param {number} machineGroupId + * @param {number} deploymentGroupId + * @param {number} machineId + * @param {number} completedRequestCount */ - updateDeploymentMachineGroupMachines(deploymentMachines, project, machineGroupId) { + getAgentRequestsForDeploymentMachine(project, deploymentGroupId, machineId, completedRequestCount) { return __awaiter(this, void 0, void 0, function* () { + if (machineId == null) { + throw new TypeError('machineId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - machineGroupId: machineGroupId + deploymentGroupId: deploymentGroupId + }; + let queryValues = { + machineId: machineId, + completedRequestCount: completedRequestCount, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "966c3874-c347-4b18-a90c-d509116717fd", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "a3540e5b-f0dc-4668-963b-b752459be545", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, deploymentMachines, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); resolve(ret); } catch (err) { @@ -22705,24 +24595,29 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.DeploymentMachine} machine * @param {string} project - Project ID or project name * @param {number} deploymentGroupId + * @param {number[]} machineIds + * @param {number} completedRequestCount */ - addDeploymentMachine(machine, project, deploymentGroupId) { + getAgentRequestsForDeploymentMachines(project, deploymentGroupId, machineIds, completedRequestCount) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, deploymentGroupId: deploymentGroupId }; + let queryValues = { + machineIds: machineIds && machineIds.join(","), + completedRequestCount: completedRequestCount, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "a3540e5b-f0dc-4668-963b-b752459be545", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, machine, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); resolve(ret); } catch (err) { @@ -22734,22 +24629,20 @@ class TaskAgentApiBase extends basem.ClientApiBase { /** * @param {string} project - Project ID or project name * @param {number} deploymentGroupId - * @param {number} machineId */ - deleteDeploymentMachine(project, deploymentGroupId, machineId) { + refreshDeploymentMachines(project, deploymentGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - deploymentGroupId: deploymentGroupId, - machineId: machineId + deploymentGroupId: deploymentGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "91006ac4-0f68-4d82-a2bc-540676bd73ce", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.create(url, null, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -22760,29 +24653,23 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - * @param {number} machineId - * @param {TaskAgentInterfaces.DeploymentMachineExpands} expand + * GET a PAT token for managing (configuring, removing, tagging) deployment agents in a deployment pool. + * + * @param {number} poolId - ID of the deployment pool in which deployment agents are managed. */ - getDeploymentMachine(project, deploymentGroupId, machineId, expand) { + generateDeploymentPoolAccessToken(poolId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId, - machineId: machineId - }; - let queryValues = { - '$expand': expand, + poolId: poolId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "e077ee4a-399b-420b-841f-c43fbc058e0b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -22792,31 +24679,28 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - * @param {string[]} tags - * @param {string} name - * @param {TaskAgentInterfaces.DeploymentMachineExpands} expand - */ - getDeploymentMachines(project, deploymentGroupId, tags, name, expand) { - return __awaiter(this, void 0, void 0, function* () { + * Get a list of deployment pool summaries. + * + * @param {string} poolName - Name of the deployment pool. + * @param {TaskAgentInterfaces.DeploymentPoolSummaryExpands} expands - Include these additional details in the returned objects. + * @param {number[]} poolIds - List of deployment pool ids. + */ + getDeploymentPoolsSummary(poolName, expands, poolIds) { + return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId - }; + let routeValues = {}; let queryValues = { - tags: tags && tags.join(","), - name: name, - '$expand': expand, + poolName: poolName, + expands: expands, + poolIds: poolIds && poolIds.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6525d6c6-258f-40e0-a1a9-8a24a3957625", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentPoolSummary, true); resolve(ret); } catch (err) { @@ -22826,26 +24710,34 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.DeploymentMachine} machine + * Get agent requests for a deployment target. + * * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - * @param {number} machineId + * @param {number} deploymentGroupId - ID of the deployment group to which the target belongs. + * @param {number} targetId - ID of the deployment target. + * @param {number} completedRequestCount - Maximum number of completed requests to return. Default is **50** */ - replaceDeploymentMachine(machine, project, deploymentGroupId, machineId) { + getAgentRequestsForDeploymentTarget(project, deploymentGroupId, targetId, completedRequestCount) { return __awaiter(this, void 0, void 0, function* () { + if (targetId == null) { + throw new TypeError('targetId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - deploymentGroupId: deploymentGroupId, - machineId: machineId + deploymentGroupId: deploymentGroupId + }; + let queryValues = { + targetId: targetId, + completedRequestCount: completedRequestCount, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "2fac0be3-8c8f-4473-ab93-c1389b08a2c9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, machine, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); resolve(ret); } catch (err) { @@ -22855,26 +24747,35 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.DeploymentMachine} machine + * Get agent requests for a list deployment targets. + * * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - * @param {number} machineId + * @param {number} deploymentGroupId - ID of the deployment group to which the targets belong. + * @param {number[]} targetIds - Comma separated list of IDs of the deployment targets. + * @param {number} ownerId - Id of owner of agent job request. + * @param {Date} completedOn - Datetime to return request after this time. + * @param {number} completedRequestCount - Maximum number of completed requests to return for each target. Default is **50** */ - updateDeploymentMachine(machine, project, deploymentGroupId, machineId) { + getAgentRequestsForDeploymentTargets(project, deploymentGroupId, targetIds, ownerId, completedOn, completedRequestCount) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - deploymentGroupId: deploymentGroupId, - machineId: machineId + deploymentGroupId: deploymentGroupId + }; + let queryValues = { + targetIds: targetIds && targetIds.join(","), + ownerId: ownerId, + completedOn: completedOn, + completedRequestCount: completedRequestCount, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "2fac0be3-8c8f-4473-ab93-c1389b08a2c9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, machine, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); resolve(ret); } catch (err) { @@ -22884,11 +24785,12 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.DeploymentMachine[]} machines + * Upgrade the deployment targets in a deployment group. + * * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId + * @param {number} deploymentGroupId - ID of the deployment group. */ - updateDeploymentMachines(machines, project, deploymentGroupId) { + refreshDeploymentTargets(project, deploymentGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { @@ -22896,12 +24798,12 @@ class TaskAgentApiBase extends basem.ClientApiBase { deploymentGroupId: deploymentGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "1c1a817f-f23d-41c6-bf8d-14b638f64152", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, machines, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -22911,22 +24813,21 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskAgentPoolMaintenanceDefinition} definition - * @param {number} poolId + * Proxy for a GET request defined by an 'endpoint'. The request is authorized using a service connection. The response is filtered using an XPath/Json based selector. + * + * @param {TaskAgentInterfaces.TaskDefinitionEndpoint} endpoint - Describes the URL to fetch. */ - createAgentPoolMaintenanceDefinition(definition, poolId) { + queryEndpoint(endpoint) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - poolId: poolId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "80572e16-58f0-4419-ac07-d19fde32195c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "f223b809-8c33-4b7d-b53f-07232569b5d6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, definition, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceDefinition, false); + res = yield this.rest.create(url, endpoint, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -22936,23 +24837,31 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number} definitionId + * Get environment deployment execution history + * + * @param {string} project - Project ID or project name + * @param {number} environmentId + * @param {string} continuationToken + * @param {number} top */ - deleteAgentPoolMaintenanceDefinition(poolId, definitionId) { + getEnvironmentDeploymentExecutionRecords(project, environmentId, continuationToken, top) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - definitionId: definitionId + project: project, + environmentId: environmentId + }; + let queryValues = { + continuationToken: continuationToken, + top: top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "80572e16-58f0-4419-ac07-d19fde32195c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "51bb5d21-4305-4ea6-9dbb-b7488af73334", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.EnvironmentDeploymentExecutionRecord, true); resolve(ret); } catch (err) { @@ -22962,23 +24871,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number} definitionId + * Create an environment. + * + * @param {TaskAgentInterfaces.EnvironmentCreateParameter} environmentCreateParameter - Environment to create. + * @param {string} project - Project ID or project name */ - getAgentPoolMaintenanceDefinition(poolId, definitionId) { + addEnvironment(environmentCreateParameter, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - definitionId: definitionId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "80572e16-58f0-4419-ac07-d19fde32195c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "8572b1fc-2482-47fa-8f74-7e3ed53ee54b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceDefinition, false); + res = yield this.rest.create(url, environmentCreateParameter, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.EnvironmentInstance, false); resolve(ret); } catch (err) { @@ -22988,21 +24898,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId + * Delete the specified environment. + * + * @param {string} project - Project ID or project name + * @param {number} environmentId - ID of the environment. */ - getAgentPoolMaintenanceDefinitions(poolId) { + deleteEnvironment(project, environmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId + project: project, + environmentId: environmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "80572e16-58f0-4419-ac07-d19fde32195c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "8572b1fc-2482-47fa-8f74-7e3ed53ee54b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceDefinition, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -23012,24 +24926,29 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskAgentPoolMaintenanceDefinition} definition - * @param {number} poolId - * @param {number} definitionId + * Get an environment by its ID. + * + * @param {string} project - Project ID or project name + * @param {number} environmentId - ID of the environment. + * @param {TaskAgentInterfaces.EnvironmentExpands} expands - Include these additional details in the returned objects. */ - updateAgentPoolMaintenanceDefinition(definition, poolId, definitionId) { + getEnvironmentById(project, environmentId, expands) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - definitionId: definitionId + project: project, + environmentId: environmentId + }; + let queryValues = { + expands: expands, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "80572e16-58f0-4419-ac07-d19fde32195c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "8572b1fc-2482-47fa-8f74-7e3ed53ee54b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, definition, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceDefinition, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.EnvironmentInstance, false); resolve(ret); } catch (err) { @@ -23039,23 +24958,31 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number} jobId + * Get all environments. + * + * @param {string} project - Project ID or project name + * @param {string} name + * @param {string} continuationToken + * @param {number} top */ - deleteAgentPoolMaintenanceJob(poolId, jobId) { + getEnvironments(project, name, continuationToken, top) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - jobId: jobId + project: project + }; + let queryValues = { + name: name, + continuationToken: continuationToken, + '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "8572b1fc-2482-47fa-8f74-7e3ed53ee54b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.EnvironmentInstance, true); resolve(ret); } catch (err) { @@ -23065,23 +24992,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number} jobId + * Update the specified environment. + * + * @param {TaskAgentInterfaces.EnvironmentUpdateParameter} environmentUpdateParameter - Environment data to update. + * @param {string} project - Project ID or project name + * @param {number} environmentId - ID of the environment. */ - getAgentPoolMaintenanceJob(poolId, jobId) { + updateEnvironment(environmentUpdateParameter, project, environmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - jobId: jobId + project: project, + environmentId: environmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "8572b1fc-2482-47fa-8f74-7e3ed53ee54b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceJob, false); + res = yield this.rest.update(url, environmentUpdateParameter, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.EnvironmentInstance, false); resolve(ret); } catch (err) { @@ -23091,22 +25021,28 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number} jobId + * @param {string} hubName + * @param {boolean} includeEnterpriseUsersCount + * @param {boolean} includeHostedAgentMinutesCount */ - getAgentPoolMaintenanceJobLogs(poolId, jobId) { + getTaskHubLicenseDetails(hubName, includeEnterpriseUsersCount, includeHostedAgentMinutesCount) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - jobId: jobId + hubName: hubName + }; + let queryValues = { + includeEnterpriseUsersCount: includeEnterpriseUsersCount, + includeHostedAgentMinutesCount: includeHostedAgentMinutesCount, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "distributedtask", "f9f0f436-b8a1-4475-9041-1ccdbf8f0128", routeValues, queryValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); } catch (err) { reject(err); @@ -23115,25 +25051,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number} definitionId + * @param {TaskAgentInterfaces.TaskHubLicenseDetails} taskHubLicenseDetails + * @param {string} hubName */ - getAgentPoolMaintenanceJobs(poolId, definitionId) { + updateTaskHubLicenseDetails(taskHubLicenseDetails, hubName) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId - }; - let queryValues = { - definitionId: definitionId, + hubName: hubName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "distributedtask", "f9f0f436-b8a1-4475-9041-1ccdbf8f0128", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceJob, true); + res = yield this.rest.replace(url, taskHubLicenseDetails, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -23143,22 +25076,19 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskAgentPoolMaintenanceJob} job - * @param {number} poolId + * @param {TaskAgentInterfaces.InputValidationRequest} inputValidationRequest */ - queueAgentPoolMaintenanceJob(job, poolId) { + validateInputs(inputValidationRequest) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - poolId: poolId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "58475b1e-adaf-4155-9bc1-e04bf1fff4c2", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, job, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceJob, false); + res = yield this.rest.create(url, inputValidationRequest, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -23168,24 +25098,34 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskAgentPoolMaintenanceJob} job * @param {number} poolId - * @param {number} jobId + * @param {number} requestId + * @param {string} lockToken + * @param {TaskAgentInterfaces.TaskResult} result + * @param {boolean} agentShuttingDown */ - updateAgentPoolMaintenanceJob(job, poolId, jobId) { + deleteAgentRequest(poolId, requestId, lockToken, result, agentShuttingDown) { return __awaiter(this, void 0, void 0, function* () { + if (lockToken == null) { + throw new TypeError('lockToken can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { poolId: poolId, - jobId: jobId + requestId: requestId + }; + let queryValues = { + lockToken: lockToken, + result: result, + agentShuttingDown: agentShuttingDown, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, job, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceJob, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -23196,29 +25136,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { } /** * @param {number} poolId - * @param {number} messageId - * @param {string} sessionId + * @param {number} requestId + * @param {boolean} includeStatus */ - deleteMessage(poolId, messageId, sessionId) { + getAgentRequest(poolId, requestId, includeStatus) { return __awaiter(this, void 0, void 0, function* () { - if (sessionId == null) { - throw new TypeError('sessionId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { poolId: poolId, - messageId: messageId + requestId: requestId }; let queryValues = { - sessionId: sessionId, + includeStatus: includeStatus, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, false); resolve(ret); } catch (err) { @@ -23229,29 +25166,29 @@ class TaskAgentApiBase extends basem.ClientApiBase { } /** * @param {number} poolId - * @param {string} sessionId - * @param {number} lastMessageId + * @param {number} top + * @param {string} continuationToken */ - getMessage(poolId, sessionId, lastMessageId) { + getAgentRequests(poolId, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { - if (sessionId == null) { - throw new TypeError('sessionId can not be null or undefined'); + if (top == null) { + throw new TypeError('top can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { poolId: poolId }; let queryValues = { - sessionId: sessionId, - lastMessageId: lastMessageId, + '$top': top, + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); resolve(ret); } catch (err) { @@ -23263,8 +25200,9 @@ class TaskAgentApiBase extends basem.ClientApiBase { /** * @param {number} poolId * @param {number} agentId + * @param {number} completedRequestCount */ - refreshAgent(poolId, agentId) { + getAgentRequestsForAgent(poolId, agentId, completedRequestCount) { return __awaiter(this, void 0, void 0, function* () { if (agentId == null) { throw new TypeError('agentId can not be null or undefined'); @@ -23275,14 +25213,15 @@ class TaskAgentApiBase extends basem.ClientApiBase { }; let queryValues = { agentId: agentId, + completedRequestCount: completedRequestCount, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); resolve(ret); } catch (err) { @@ -23293,20 +25232,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { } /** * @param {number} poolId + * @param {number[]} agentIds + * @param {number} completedRequestCount */ - refreshAgents(poolId) { + getAgentRequestsForAgents(poolId, agentIds, completedRequestCount) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { poolId: poolId }; + let queryValues = { + agentIds: agentIds && agentIds.join(","), + completedRequestCount: completedRequestCount, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); resolve(ret); } catch (err) { @@ -23316,29 +25261,30 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskAgentMessage} message * @param {number} poolId - * @param {number} requestId + * @param {string} planId + * @param {string} jobId */ - sendMessage(message, poolId, requestId) { + getAgentRequestsForPlan(poolId, planId, jobId) { return __awaiter(this, void 0, void 0, function* () { - if (requestId == null) { - throw new TypeError('requestId can not be null or undefined'); + if (planId == null) { + throw new TypeError('planId can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { poolId: poolId }; let queryValues = { - requestId: requestId, + planId: planId, + jobId: jobId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, message, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, true); resolve(ret); } catch (err) { @@ -23348,25 +25294,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} packageType - * @param {string} platform - * @param {string} version + * @param {TaskAgentInterfaces.TaskAgentJobRequest} request + * @param {number} poolId */ - getPackage(packageType, platform, version) { + queueAgentRequestByPool(request, poolId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - packageType: packageType, - platform: platform, - version: version + poolId: poolId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "8ffcd551-079c-493a-9c02-54346299d144", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.PackageMetadata, false); + res = yield this.rest.create(url, request, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, false); resolve(ret); } catch (err) { @@ -23376,27 +25319,33 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} packageType - * @param {string} platform - * @param {number} top + * @param {TaskAgentInterfaces.TaskAgentJobRequest} request + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @param {TaskAgentInterfaces.TaskAgentRequestUpdateOptions} updateOptions */ - getPackages(packageType, platform, top) { + updateAgentRequest(request, poolId, requestId, lockToken, updateOptions) { return __awaiter(this, void 0, void 0, function* () { + if (lockToken == null) { + throw new TypeError('lockToken can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - packageType: packageType, - platform: platform + poolId: poolId, + requestId: requestId }; let queryValues = { - '$top': top, + lockToken: lockToken, + updateOptions: updateOptions, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "8ffcd551-079c-493a-9c02-54346299d144", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "fc825784-c92a-4299-9221-998a02d1b54f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.PackageMetadata, true); + res = yield this.rest.update(url, request, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJobRequest, false); resolve(ret); } catch (err) { @@ -23406,20 +25355,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId + * @param {TaskAgentInterfaces.KubernetesResourceCreateParameters} createParameters + * @param {string} project - Project ID or project name + * @param {number} environmentId */ - getAgentPoolMetadata(poolId) { + addKubernetesResource(createParameters, project, environmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId + project: project, + environmentId: environmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "0d62f887-9f53-48b9-9161-4c35d5735b0f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "73fba52f-15ab-42b3-a538-ce67a9223a04", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, createParameters, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.KubernetesResource, false); + resolve(ret); } catch (err) { reject(err); @@ -23428,24 +25382,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {any} agentPoolMetadata - * @param {number} poolId + * @param {string} project - Project ID or project name + * @param {number} environmentId + * @param {number} resourceId */ - setAgentPoolMetadata(customHeaders, agentPoolMetadata, poolId) { + deleteKubernetesResource(project, environmentId, resourceId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId + project: project, + environmentId: environmentId, + resourceId: resourceId }; - customHeaders = customHeaders || {}; - customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "0d62f887-9f53-48b9-9161-4c35d5735b0f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "73fba52f-15ab-42b3-a538-ce67a9223a04", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); - options.additionalHeaders = customHeaders; let res; - res = yield this.rest.replace(url, agentPoolMetadata, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -23456,21 +25410,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Create an agent pool. - * - * @param {TaskAgentInterfaces.TaskAgentPool} pool - Details about the new agent pool + * @param {string} project - Project ID or project name + * @param {number} environmentId + * @param {number} resourceId */ - addAgentPool(pool) { + getKubernetesResource(project, environmentId, resourceId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + environmentId: environmentId, + resourceId: resourceId + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "73fba52f-15ab-42b3-a538-ce67a9223a04", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, pool, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPool, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.KubernetesResource, false); resolve(ret); } catch (err) { @@ -23480,22 +25438,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Delete an agent pool. - * - * @param {number} poolId - ID of the agent pool to delete + * @param {string} project - Project ID or project name + * @param {number} machineGroupId */ - deleteAgentPool(poolId) { + generateDeploymentMachineGroupAccessToken(project, machineGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId + project: project, + machineGroupId: machineGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "f8c7c0de-ac0d-469b-9cb1-c21f72d67693", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.create(url, null, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -23506,29 +25464,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get information about an agent pool. - * - * @param {number} poolId - An agent pool ID - * @param {string[]} properties - Agent pool properties (comma-separated) - * @param {TaskAgentInterfaces.TaskAgentPoolActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions + * @param {TaskAgentInterfaces.DeploymentMachineGroup} machineGroup + * @param {string} project - Project ID or project name */ - getAgentPool(poolId, properties, actionFilter) { + addDeploymentMachineGroup(machineGroup, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId - }; - let queryValues = { - properties: properties && properties.join(","), - actionFilter: actionFilter, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "d4adf50f-80c6-4ac8-9ca1-6e4e544286e9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPool, false); + res = yield this.rest.create(url, machineGroup, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachineGroup, false); resolve(ret); } catch (err) { @@ -23538,30 +25489,23 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of agent pools. - * - * @param {string} poolName - Filter by name - * @param {string[]} properties - Filter by agent pool properties (comma-separated) - * @param {TaskAgentInterfaces.TaskAgentPoolType} poolType - Filter by pool type - * @param {TaskAgentInterfaces.TaskAgentPoolActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions + * @param {string} project - Project ID or project name + * @param {number} machineGroupId */ - getAgentPools(poolName, properties, poolType, actionFilter) { + deleteDeploymentMachineGroup(project, machineGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - poolName: poolName, - properties: properties && properties.join(","), - poolType: poolType, - actionFilter: actionFilter, + let routeValues = { + project: project, + machineGroupId: machineGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "d4adf50f-80c6-4ac8-9ca1-6e4e544286e9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPool, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -23571,29 +25515,27 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of agent pools. - * - * @param {number[]} poolIds - pool Ids to fetch - * @param {TaskAgentInterfaces.TaskAgentPoolActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions + * @param {string} project - Project ID or project name + * @param {number} machineGroupId + * @param {TaskAgentInterfaces.MachineGroupActionFilter} actionFilter */ - getAgentPoolsByIds(poolIds, actionFilter) { + getDeploymentMachineGroup(project, machineGroupId, actionFilter) { return __awaiter(this, void 0, void 0, function* () { - if (poolIds == null) { - throw new TypeError('poolIds can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + machineGroupId: machineGroupId + }; let queryValues = { - poolIds: poolIds && poolIds.join(","), actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "d4adf50f-80c6-4ac8-9ca1-6e4e544286e9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPool, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachineGroup, false); resolve(ret); } catch (err) { @@ -23603,24 +25545,27 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Update properties on an agent pool - * - * @param {TaskAgentInterfaces.TaskAgentPool} pool - Updated agent pool details - * @param {number} poolId - The agent pool to update + * @param {string} project - Project ID or project name + * @param {string} machineGroupName + * @param {TaskAgentInterfaces.MachineGroupActionFilter} actionFilter */ - updateAgentPool(pool, poolId) { + getDeploymentMachineGroups(project, machineGroupName, actionFilter) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId + project: project + }; + let queryValues = { + machineGroupName: machineGroupName, + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "d4adf50f-80c6-4ac8-9ca1-6e4e544286e9", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, pool, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPool, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachineGroup, true); resolve(ret); } catch (err) { @@ -23630,28 +25575,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Create a new agent queue to connect a project to an agent pool. - * - * @param {TaskAgentInterfaces.TaskAgentQueue} queue - Details about the queue to create + * @param {TaskAgentInterfaces.DeploymentMachineGroup} machineGroup * @param {string} project - Project ID or project name - * @param {boolean} authorizePipelines - Automatically authorize this queue when using YAML + * @param {number} machineGroupId */ - addAgentQueue(queue, project, authorizePipelines) { + updateDeploymentMachineGroup(machineGroup, project, machineGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - authorizePipelines: authorizePipelines, + project: project, + machineGroupId: machineGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "d4adf50f-80c6-4ac8-9ca1-6e4e544286e9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, queue, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, false); + res = yield this.rest.update(url, machineGroup, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachineGroup, false); resolve(ret); } catch (err) { @@ -23661,23 +25602,27 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Create a new team project. - * * @param {string} project - Project ID or project name + * @param {number} machineGroupId + * @param {string[]} tagFilters */ - createTeamProject(project) { + getDeploymentMachineGroupMachines(project, machineGroupId, tagFilters) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + machineGroupId: machineGroupId + }; + let queryValues = { + tagFilters: tagFilters && tagFilters.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "966c3874-c347-4b18-a90c-d509116717fd", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, null, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); resolve(ret); } catch (err) { @@ -23687,25 +25632,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Removes an agent queue from a project. - * - * @param {number} queueId - The agent queue to remove + * @param {TaskAgentInterfaces.DeploymentMachine[]} deploymentMachines * @param {string} project - Project ID or project name + * @param {number} machineGroupId */ - deleteAgentQueue(queueId, project) { + updateDeploymentMachineGroupMachines(deploymentMachines, project, machineGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - queueId: queueId + machineGroupId: machineGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "966c3874-c347-4b18-a90c-d509116717fd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, deploymentMachines, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); resolve(ret); } catch (err) { @@ -23715,29 +25659,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get information about an agent queue. - * - * @param {number} queueId - The agent queue to get information about + * @param {TaskAgentInterfaces.DeploymentMachine} machine * @param {string} project - Project ID or project name - * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions + * @param {number} deploymentGroupId */ - getAgentQueue(queueId, project, actionFilter) { + addDeploymentMachine(machine, project, deploymentGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - queueId: queueId - }; - let queryValues = { - actionFilter: actionFilter, + deploymentGroupId: deploymentGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, false); + res = yield this.rest.create(url, machine, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); resolve(ret); } catch (err) { @@ -23747,29 +25686,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of agent queues. - * * @param {string} project - Project ID or project name - * @param {string} queueName - Filter on the agent queue name - * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions + * @param {number} deploymentGroupId + * @param {number} machineId */ - getAgentQueues(project, queueName, actionFilter) { + deleteDeploymentMachine(project, deploymentGroupId, machineId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - queueName: queueName, - actionFilter: actionFilter, + project: project, + deploymentGroupId: deploymentGroupId, + machineId: machineId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -23779,32 +25714,29 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of agent queues by their IDs - * - * @param {number[]} queueIds - A comma-separated list of agent queue IDs to retrieve * @param {string} project - Project ID or project name - * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions + * @param {number} deploymentGroupId + * @param {number} machineId + * @param {TaskAgentInterfaces.DeploymentMachineExpands} expand */ - getAgentQueuesByIds(queueIds, project, actionFilter) { + getDeploymentMachine(project, deploymentGroupId, machineId, expand) { return __awaiter(this, void 0, void 0, function* () { - if (queueIds == null) { - throw new TypeError('queueIds can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + deploymentGroupId: deploymentGroupId, + machineId: machineId }; let queryValues = { - queueIds: queueIds && queueIds.join(","), - actionFilter: actionFilter, + '$expand': expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); resolve(ret); } catch (err) { @@ -23814,32 +25746,31 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of agent queues by their names - * - * @param {string[]} queueNames - A comma-separated list of agent names to retrieve * @param {string} project - Project ID or project name - * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions + * @param {number} deploymentGroupId + * @param {string[]} tags + * @param {string} name + * @param {TaskAgentInterfaces.DeploymentMachineExpands} expand */ - getAgentQueuesByNames(queueNames, project, actionFilter) { + getDeploymentMachines(project, deploymentGroupId, tags, name, expand) { return __awaiter(this, void 0, void 0, function* () { - if (queueNames == null) { - throw new TypeError('queueNames can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + deploymentGroupId: deploymentGroupId }; let queryValues = { - queueNames: queueNames && queueNames.join(","), - actionFilter: actionFilter, + tags: tags && tags.join(","), + name: name, + '$expand': expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); resolve(ret); } catch (err) { @@ -23849,32 +25780,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of agent queues by pool ids - * - * @param {number[]} poolIds - A comma-separated list of pool ids to get the corresponding queues for + * @param {TaskAgentInterfaces.DeploymentMachine} machine * @param {string} project - Project ID or project name - * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions + * @param {number} deploymentGroupId + * @param {number} machineId */ - getAgentQueuesForPools(poolIds, project, actionFilter) { + replaceDeploymentMachine(machine, project, deploymentGroupId, machineId) { return __awaiter(this, void 0, void 0, function* () { - if (poolIds == null) { - throw new TypeError('poolIds can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - poolIds: poolIds && poolIds.join(","), - actionFilter: actionFilter, + project: project, + deploymentGroupId: deploymentGroupId, + machineId: machineId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, true); + res = yield this.rest.replace(url, machine, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); resolve(ret); } catch (err) { @@ -23884,21 +25809,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} agentCloudId + * @param {TaskAgentInterfaces.DeploymentMachine} machine + * @param {string} project - Project ID or project name + * @param {number} deploymentGroupId + * @param {number} machineId */ - getAgentCloudRequests(agentCloudId) { + updateDeploymentMachine(machine, project, deploymentGroupId, machineId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - agentCloudId: agentCloudId + project: project, + deploymentGroupId: deploymentGroupId, + machineId: machineId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "20189bd7-5134-49c2-b8e9-f9e856eea2b2", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentCloudRequest, true); + res = yield this.rest.update(url, machine, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); resolve(ret); } catch (err) { @@ -23908,18 +25838,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * @param {TaskAgentInterfaces.DeploymentMachine[]} machines + * @param {string} project - Project ID or project name + * @param {number} deploymentGroupId */ - getResourceLimits() { + updateDeploymentMachines(machines, project, deploymentGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + deploymentGroupId: deploymentGroupId + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "1f1f0557-c445-42a6-b4a0-0df605a3a0f8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6f6d406f-cfe6-409c-9327-7009928077e7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.update(url, machines, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); resolve(ret); } catch (err) { @@ -23929,26 +25865,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} parallelismTag - * @param {boolean} poolIsHosted - * @param {boolean} includeRunningRequests + * @param {TaskAgentInterfaces.TaskAgentPoolMaintenanceDefinition} definition + * @param {number} poolId */ - getResourceUsage(parallelismTag, poolIsHosted, includeRunningRequests) { + createAgentPoolMaintenanceDefinition(definition, poolId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - parallelismTag: parallelismTag, - poolIsHosted: poolIsHosted, - includeRunningRequests: includeRunningRequests, + let routeValues = { + poolId: poolId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "eae1d376-a8b1-4475-9041-1dfdbe8f0143", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "80572e16-58f0-4419-ac07-d19fde32195c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.ResourceUsage, false); + res = yield this.rest.create(url, definition, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceDefinition, false); resolve(ret); } catch (err) { @@ -23958,23 +25890,23 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {string} taskGroupId + * @param {number} poolId + * @param {number} definitionId */ - getTaskGroupHistory(project, taskGroupId) { + deleteAgentPoolMaintenanceDefinition(poolId, definitionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - taskGroupId: taskGroupId + poolId: poolId, + definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "100cc92a-b255-47fa-9ab3-e44a2985a3ac", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "80572e16-58f0-4419-ac07-d19fde32195c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroupRevision, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -23984,25 +25916,23 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Delete a secure file - * - * @param {string} project - Project ID or project name - * @param {string} secureFileId - The unique secure file Id + * @param {number} poolId + * @param {number} definitionId */ - deleteSecureFile(project, secureFileId) { + getAgentPoolMaintenanceDefinition(poolId, definitionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - secureFileId: secureFileId + poolId: poolId, + definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "80572e16-58f0-4419-ac07-d19fde32195c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceDefinition, false); resolve(ret); } catch (err) { @@ -24012,33 +25942,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Download a secure file by Id - * - * @param {string} project - Project ID or project name - * @param {string} secureFileId - The unique secure file Id - * @param {string} ticket - A valid download ticket - * @param {boolean} download - If download is true, the file is sent as attachement in the response body. If download is false, the response body contains the file stream. + * @param {number} poolId */ - downloadSecureFile(project, secureFileId, ticket, download) { + getAgentPoolMaintenanceDefinitions(poolId) { return __awaiter(this, void 0, void 0, function* () { - if (ticket == null) { - throw new TypeError('ticket can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - secureFileId: secureFileId - }; - let queryValues = { - ticket: ticket, - download: download, + poolId: poolId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "80572e16-58f0-4419-ac07-d19fde32195c", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceDefinition, true); + resolve(ret); } catch (err) { reject(err); @@ -24047,31 +25966,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a secure file - * - * @param {string} project - Project ID or project name - * @param {string} secureFileId - The unique secure file Id - * @param {boolean} includeDownloadTicket - If includeDownloadTicket is true and the caller has permissions, a download ticket is included in the response. - * @param {TaskAgentInterfaces.SecureFileActionFilter} actionFilter + * @param {TaskAgentInterfaces.TaskAgentPoolMaintenanceDefinition} definition + * @param {number} poolId + * @param {number} definitionId */ - getSecureFile(project, secureFileId, includeDownloadTicket, actionFilter) { + updateAgentPoolMaintenanceDefinition(definition, poolId, definitionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - secureFileId: secureFileId - }; - let queryValues = { - includeDownloadTicket: includeDownloadTicket, - actionFilter: actionFilter, + poolId: poolId, + definitionId: definitionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "80572e16-58f0-4419-ac07-d19fde32195c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, false); + res = yield this.rest.replace(url, definition, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceDefinition, false); resolve(ret); } catch (err) { @@ -24081,31 +25993,23 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get secure files - * - * @param {string} project - Project ID or project name - * @param {string} namePattern - Name of the secure file to match. Can include wildcards to match multiple files. - * @param {boolean} includeDownloadTickets - If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response. - * @param {TaskAgentInterfaces.SecureFileActionFilter} actionFilter - Filter by secure file permissions for View, Manage or Use action. Defaults to View. + * @param {number} poolId + * @param {number} jobId */ - getSecureFiles(project, namePattern, includeDownloadTickets, actionFilter) { + deleteAgentPoolMaintenanceJob(poolId, jobId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - namePattern: namePattern, - includeDownloadTickets: includeDownloadTickets, - actionFilter: actionFilter, + poolId: poolId, + jobId: jobId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -24115,34 +26019,23 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get secure files - * - * @param {string} project - Project ID or project name - * @param {string[]} secureFileIds - A list of secure file Ids - * @param {boolean} includeDownloadTickets - If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response. - * @param {TaskAgentInterfaces.SecureFileActionFilter} actionFilter + * @param {number} poolId + * @param {number} jobId */ - getSecureFilesByIds(project, secureFileIds, includeDownloadTickets, actionFilter) { + getAgentPoolMaintenanceJob(poolId, jobId) { return __awaiter(this, void 0, void 0, function* () { - if (secureFileIds == null) { - throw new TypeError('secureFileIds can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - secureFileIds: secureFileIds && secureFileIds.join(","), - includeDownloadTickets: includeDownloadTickets, - actionFilter: actionFilter, + poolId: poolId, + jobId: jobId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceJob, false); resolve(ret); } catch (err) { @@ -24152,35 +26045,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get secure files - * - * @param {string} project - Project ID or project name - * @param {string[]} secureFileNames - A list of secure file Ids - * @param {boolean} includeDownloadTickets - If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response. - * @param {TaskAgentInterfaces.SecureFileActionFilter} actionFilter + * @param {number} poolId + * @param {number} jobId */ - getSecureFilesByNames(project, secureFileNames, includeDownloadTickets, actionFilter) { + getAgentPoolMaintenanceJobLogs(poolId, jobId) { return __awaiter(this, void 0, void 0, function* () { - if (secureFileNames == null) { - throw new TypeError('secureFileNames can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - secureFileNames: secureFileNames && secureFileNames.join(","), - includeDownloadTickets: includeDownloadTickets, - actionFilter: actionFilter, + poolId: poolId, + jobId: jobId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -24189,28 +26069,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Query secure files using a name pattern and a condition on file properties. - * - * @param {string} condition - The main condition syntax is described [here](https://go.microsoft.com/fwlink/?linkid=842996). Use the *property('property-name')* function to access the value of the specified property of a secure file. It returns null if the property is not set. E.g. ``` and( eq( property('devices'), '2' ), in( property('provisioning profile type'), 'ad hoc', 'development' ) ) ``` - * @param {string} project - Project ID or project name - * @param {string} namePattern - Name of the secure file to match. Can include wildcards to match multiple files. + * @param {number} poolId + * @param {number} definitionId */ - querySecureFilesByProperties(condition, project, namePattern) { + getAgentPoolMaintenanceJobs(poolId, definitionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + poolId: poolId }; let queryValues = { - namePattern: namePattern, + definitionId: definitionId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, condition, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceJob, true); resolve(ret); } catch (err) { @@ -24220,26 +26097,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Update the name or properties of an existing secure file - * - * @param {TaskAgentInterfaces.SecureFile} secureFile - The secure file with updated name and/or properties - * @param {string} project - Project ID or project name - * @param {string} secureFileId - The unique secure file Id + * @param {TaskAgentInterfaces.TaskAgentPoolMaintenanceJob} job + * @param {number} poolId */ - updateSecureFile(secureFile, project, secureFileId) { + queueAgentPoolMaintenanceJob(job, poolId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - secureFileId: secureFileId + poolId: poolId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, secureFile, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, false); + res = yield this.rest.create(url, job, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceJob, false); resolve(ret); } catch (err) { @@ -24249,24 +26122,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Update properties and/or names of a set of secure files. Files are identified by their IDs. Properties provided override the existing one entirely, i.e. do not merge. - * - * @param {TaskAgentInterfaces.SecureFile[]} secureFiles - A list of secure file objects. Only three field must be populated Id, Name, and Properties. The rest of fields in the object are ignored. - * @param {string} project - Project ID or project name + * @param {TaskAgentInterfaces.TaskAgentPoolMaintenanceJob} job + * @param {number} poolId + * @param {number} jobId */ - updateSecureFiles(secureFiles, project) { + updateAgentPoolMaintenanceJob(job, poolId, jobId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + poolId: poolId, + jobId: jobId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "15e7ab6e-abce-4601-a6d8-e111fe148f46", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, secureFiles, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, true); + res = yield this.rest.update(url, job, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPoolMaintenanceJob, false); resolve(ret); } catch (err) { @@ -24276,36 +26149,30 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Upload a secure file, include the file stream in the request body - * - * @param {NodeJS.ReadableStream} contentStream - Content to upload - * @param {string} project - Project ID or project name - * @param {string} name - Name of the file to upload - * @param {boolean} authorizePipelines - If authorizePipelines is true, then the secure file is authorized for use by all pipelines in the project. + * @param {number} poolId + * @param {number} messageId + * @param {string} sessionId */ - uploadSecureFile(customHeaders, contentStream, project, name, authorizePipelines) { + deleteMessage(poolId, messageId, sessionId) { return __awaiter(this, void 0, void 0, function* () { - if (name == null) { - throw new TypeError('name can not be null or undefined'); + if (sessionId == null) { + throw new TypeError('sessionId can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + poolId: poolId, + messageId: messageId }; let queryValues = { - name: name, - authorizePipelines: authorizePipelines, + sessionId: sessionId, }; - customHeaders = customHeaders || {}; - customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); - options.additionalHeaders = customHeaders; let res; - res = yield this.rest.uploadStream("POST", url, contentStream, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -24315,22 +26182,30 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskAgentSession} session * @param {number} poolId + * @param {string} sessionId + * @param {number} lastMessageId */ - createAgentSession(session, poolId) { + getMessage(poolId, sessionId, lastMessageId) { return __awaiter(this, void 0, void 0, function* () { + if (sessionId == null) { + throw new TypeError('sessionId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { poolId: poolId }; + let queryValues = { + sessionId: sessionId, + lastMessageId: lastMessageId, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "134e239e-2df3-4794-a6f6-24f1f19ec8dc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, session, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentSession, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -24341,21 +26216,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { } /** * @param {number} poolId - * @param {string} sessionId + * @param {number} agentId */ - deleteAgentSession(poolId, sessionId) { + refreshAgent(poolId, agentId) { return __awaiter(this, void 0, void 0, function* () { + if (agentId == null) { + throw new TypeError('agentId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - sessionId: sessionId + poolId: poolId + }; + let queryValues = { + agentId: agentId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "134e239e-2df3-4794-a6f6-24f1f19ec8dc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.create(url, null, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -24366,26 +26246,21 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Register a deployment target to a deployment group. Generally this is called by agent configuration tool. - * - * @param {TaskAgentInterfaces.DeploymentMachine} machine - Deployment target to register. - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group to which the deployment target is registered. + * @param {number} poolId */ - addDeploymentTarget(machine, project, deploymentGroupId) { + refreshAgents(poolId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId + poolId: poolId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, machine, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -24395,26 +26270,28 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too. - * - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group in which deployment target is deleted. - * @param {number} targetId - ID of the deployment target to delete. + * @param {TaskAgentInterfaces.TaskAgentMessage} message + * @param {number} poolId + * @param {number} requestId */ - deleteDeploymentTarget(project, deploymentGroupId, targetId) { + sendMessage(message, poolId, requestId) { return __awaiter(this, void 0, void 0, function* () { + if (requestId == null) { + throw new TypeError('requestId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId, - targetId: targetId + poolId: poolId + }; + let queryValues = { + requestId: requestId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "c3a054f6-7a8a-49c0-944e-3a8e5d7adfd7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.create(url, message, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -24425,31 +26302,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a deployment target by its ID in a deployment group - * - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group to which deployment target belongs. - * @param {number} targetId - ID of the deployment target to return. - * @param {TaskAgentInterfaces.DeploymentTargetExpands} expand - Include these additional details in the returned objects. + * @param {string} packageType + * @param {string} platform + * @param {string} version */ - getDeploymentTarget(project, deploymentGroupId, targetId, expand) { + getPackage(packageType, platform, version) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId, - targetId: targetId - }; - let queryValues = { - '$expand': expand, + packageType: packageType, + platform: platform, + version: version }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "8ffcd551-079c-493a-9c02-54346299d144", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.PackageMetadata, false); resolve(ret); } catch (err) { @@ -24459,47 +26330,27 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a list of deployment targets in a deployment group. - * - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group. - * @param {string[]} tags - Get only the deployment targets that contain all these comma separted list of tags. - * @param {string} name - Name pattern of the deployment targets to return. - * @param {boolean} partialNameMatch - When set to true, treats **name** as pattern. Else treats it as absolute match. Default is **false**. - * @param {TaskAgentInterfaces.DeploymentTargetExpands} expand - Include these additional details in the returned objects. - * @param {TaskAgentInterfaces.TaskAgentStatusFilter} agentStatus - Get only deployment targets that have this status. - * @param {TaskAgentInterfaces.TaskAgentJobResultFilter} agentJobResult - Get only deployment targets that have this last job result. - * @param {string} continuationToken - Get deployment targets with names greater than this continuationToken lexicographically. - * @param {number} top - Maximum number of deployment targets to return. Default is **1000**. - * @param {boolean} enabled - Get only deployment targets that are enabled or disabled. Default is 'null' which returns all the targets. - * @param {string[]} propertyFilters + * @param {string} packageType + * @param {string} platform + * @param {number} top */ - getDeploymentTargets(project, deploymentGroupId, tags, name, partialNameMatch, expand, agentStatus, agentJobResult, continuationToken, top, enabled, propertyFilters) { + getPackages(packageType, platform, top) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId + packageType: packageType, + platform: platform }; let queryValues = { - tags: tags && tags.join(","), - name: name, - partialNameMatch: partialNameMatch, - '$expand': expand, - agentStatus: agentStatus, - agentJobResult: agentJobResult, - continuationToken: continuationToken, '$top': top, - enabled: enabled, - propertyFilters: propertyFilters && propertyFilters.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "8ffcd551-079c-493a-9c02-54346299d144", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.PackageMetadata, true); resolve(ret); } catch (err) { @@ -24509,29 +26360,20 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Replace a deployment target in a deployment group. Generally this is called by agent configuration tool. - * - * @param {TaskAgentInterfaces.DeploymentMachine} machine - New deployment target. - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group in which deployment target is replaced. - * @param {number} targetId - ID of the deployment target to replace. + * @param {number} poolId */ - replaceDeploymentTarget(machine, project, deploymentGroupId, targetId) { + getAgentPoolMetadata(poolId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId, - targetId: targetId + poolId: poolId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "0d62f887-9f53-48b9-9161-4c35d5735b0f", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.replace(url, machine, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -24540,28 +26382,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Update a deployment target and its agent properties in a deployment group. Generally this is called by agent configuration tool. - * - * @param {TaskAgentInterfaces.DeploymentMachine} machine - Deployment target to update. - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group in which deployment target is updated. - * @param {number} targetId - ID of the deployment target to update. + * @param {any} agentPoolMetadata + * @param {number} poolId */ - updateDeploymentTarget(machine, project, deploymentGroupId, targetId) { + setAgentPoolMetadata(customHeaders, agentPoolMetadata, poolId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId, - targetId: targetId + poolId: poolId }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "0d62f887-9f53-48b9-9161-4c35d5735b0f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.update(url, machine, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); + res = yield this.rest.replace(url, agentPoolMetadata, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -24571,26 +26410,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Update tags of a list of deployment targets in a deployment group. + * Checks if current identity has passed permissions on a pool. * - * @param {TaskAgentInterfaces.DeploymentTargetUpdateParameter[]} machines - Deployment targets with tags to udpdate. - * @param {string} project - Project ID or project name - * @param {number} deploymentGroupId - ID of the deployment group in which deployment targets are updated. + * @param {number} poolId - Id of the pool to check + * @param {number} permissions - Permissions to check. Multiple permissions might be merged into single value using bitwise OR operator (e.g. AgentPoolPermissions.Manage | AgentPoolPermissions.View) */ - updateDeploymentTargets(machines, project, deploymentGroupId) { + hasPoolPermissions(poolId, permissions) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - deploymentGroupId: deploymentGroupId + poolId: poolId, + permissions: permissions }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "162778f3-4b48-48f3-9d58-436fb9c407bc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, machines, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -24600,24 +26438,21 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Create a task group. + * Create an agent pool. * - * @param {TaskAgentInterfaces.TaskGroupCreateParameter} taskGroup - Task group object to create. - * @param {string} project - Project ID or project name + * @param {TaskAgentInterfaces.TaskAgentPool} pool - Details about the new agent pool */ - addTaskGroup(taskGroup, project) { + addAgentPool(pool) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, taskGroup, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, false); + res = yield this.rest.create(url, pool, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPool, false); resolve(ret); } catch (err) { @@ -24627,24 +26462,18 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Delete a task group. + * Delete an agent pool. * - * @param {string} project - Project ID or project name - * @param {string} taskGroupId - Id of the task group to be deleted. - * @param {string} comment - Comments to delete. + * @param {number} poolId - ID of the agent pool to delete */ - deleteTaskGroup(project, taskGroupId, comment) { + deleteAgentPool(poolId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - taskGroupId: taskGroupId - }; - let queryValues = { - comment: comment, + poolId: poolId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -24659,34 +26488,29 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get task group. + * Get information about an agent pool. * - * @param {string} project - Project ID or project name - * @param {string} taskGroupId - Id of the task group. - * @param {string} versionSpec - version specification of the task group. examples: 1, 1.0. - * @param {TaskAgentInterfaces.TaskGroupExpands} expand - The properties that should be expanded. example $expand=Tasks will expand nested task groups. + * @param {number} poolId - An agent pool ID + * @param {string[]} properties - Agent pool properties (comma-separated) + * @param {TaskAgentInterfaces.TaskAgentPoolActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions */ - getTaskGroup(project, taskGroupId, versionSpec, expand) { + getAgentPool(poolId, properties, actionFilter) { return __awaiter(this, void 0, void 0, function* () { - if (versionSpec == null) { - throw new TypeError('versionSpec can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - taskGroupId: taskGroupId + poolId: poolId }; let queryValues = { - versionSpec: versionSpec, - '$expand': expand, + properties: properties && properties.join(","), + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPool, false); resolve(ret); } catch (err) { @@ -24696,29 +26520,31 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {string} taskGroupId - * @param {number} revision + * Get a list of agent pools. + * + * @param {string} poolName - Filter by name + * @param {string[]} properties - Filter by agent pool properties (comma-separated) + * @param {TaskAgentInterfaces.TaskAgentPoolType} poolType - Filter by pool type + * @param {TaskAgentInterfaces.TaskAgentPoolActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions */ - getTaskGroupRevision(project, taskGroupId, revision) { + getAgentPools(poolName, properties, poolType, actionFilter) { return __awaiter(this, void 0, void 0, function* () { - if (revision == null) { - throw new TypeError('revision can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - taskGroupId: taskGroupId - }; + let routeValues = {}; let queryValues = { - revision: revision, + poolName: poolName, + properties: properties && properties.join(","), + poolType: poolType, + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues, queryValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPool, true); + resolve(ret); } catch (err) { reject(err); @@ -24727,39 +26553,29 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * List task groups. + * Get a list of agent pools. * - * @param {string} project - Project ID or project name - * @param {string} taskGroupId - Id of the task group. - * @param {boolean} expanded - 'true' to recursively expand task groups. Default is 'false'. - * @param {string} taskIdFilter - Guid of the taskId to filter. - * @param {boolean} deleted - 'true'to include deleted task groups. Default is 'false'. - * @param {number} top - Number of task groups to get. - * @param {Date} continuationToken - Gets the task groups after the continuation token provided. - * @param {TaskAgentInterfaces.TaskGroupQueryOrder} queryOrder - Gets the results in the defined order. Default is 'CreatedOnDescending'. + * @param {number[]} poolIds - pool Ids to fetch + * @param {TaskAgentInterfaces.TaskAgentPoolActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions */ - getTaskGroups(project, taskGroupId, expanded, taskIdFilter, deleted, top, continuationToken, queryOrder) { + getAgentPoolsByIds(poolIds, actionFilter) { return __awaiter(this, void 0, void 0, function* () { + if (poolIds == null) { + throw new TypeError('poolIds can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - taskGroupId: taskGroupId - }; + let routeValues = {}; let queryValues = { - expanded: expanded, - taskIdFilter: taskIdFilter, - deleted: deleted, - '$top': top, - continuationToken: continuationToken, - queryOrder: queryOrder, + poolIds: poolIds && poolIds.join(","), + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPool, true); resolve(ret); } catch (err) { @@ -24769,29 +26585,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.PublishTaskGroupMetadata} taskGroupMetadata - * @param {string} project - Project ID or project name - * @param {string} parentTaskGroupId + * Update properties on an agent pool + * + * @param {TaskAgentInterfaces.TaskAgentPool} pool - Updated agent pool details + * @param {number} poolId - The agent pool to update */ - publishTaskGroup(taskGroupMetadata, project, parentTaskGroupId) { + updateAgentPool(pool, poolId) { return __awaiter(this, void 0, void 0, function* () { - if (parentTaskGroupId == null) { - throw new TypeError('parentTaskGroupId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - parentTaskGroupId: parentTaskGroupId, + poolId: poolId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "a8c47e17-4d56-4a56-92bb-de7ea7dc65be", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, taskGroupMetadata, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, true); + res = yield this.rest.update(url, pool, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentPool, false); resolve(ret); } catch (err) { @@ -24801,22 +26612,28 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskGroup} taskGroup + * Create a new agent queue to connect a project to an agent pool. + * + * @param {TaskAgentInterfaces.TaskAgentQueue} queue - Details about the queue to create * @param {string} project - Project ID or project name + * @param {boolean} authorizePipelines - Automatically authorize this queue when using YAML */ - undeleteTaskGroup(taskGroup, project) { + addAgentQueue(queue, project, authorizePipelines) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + authorizePipelines: authorizePipelines, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, taskGroup, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, true); + res = yield this.rest.create(url, queue, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, false); resolve(ret); } catch (err) { @@ -24826,26 +26643,23 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Update a task group. + * Create a new team project. * - * @param {TaskAgentInterfaces.TaskGroupUpdateParameter} taskGroup - Task group to update. * @param {string} project - Project ID or project name - * @param {string} taskGroupId - Id of the task group to update. */ - updateTaskGroup(taskGroup, project, taskGroupId) { + createTeamProject(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - taskGroupId: taskGroupId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, taskGroup, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, false); + res = yield this.rest.replace(url, null, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -24855,28 +26669,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskGroupUpdatePropertiesBase} taskGroupUpdateProperties + * Removes an agent queue from a project. + * + * @param {number} queueId - The agent queue to remove * @param {string} project - Project ID or project name - * @param {string} taskGroupId - * @param {boolean} disablePriorVersions */ - updateTaskGroupProperties(taskGroupUpdateProperties, project, taskGroupId, disablePriorVersions) { + deleteAgentQueue(queueId, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - taskGroupId: taskGroupId - }; - let queryValues = { - disablePriorVersions: disablePriorVersions, + queueId: queueId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, taskGroupUpdateProperties, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -24886,21 +26697,29 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} taskId + * Get information about an agent queue. + * + * @param {number} queueId - The agent queue to get information about + * @param {string} project - Project ID or project name + * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions */ - deleteTaskDefinition(taskId) { + getAgentQueue(queueId, project, actionFilter) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - taskId: taskId + project: project, + queueId: queueId + }; + let queryValues = { + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, false); resolve(ret); } catch (err) { @@ -24910,28 +26729,30 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} taskId - * @param {string} versionString - * @param {string[]} visibility - * @param {boolean} scopeLocal + * Get a list of agent queues. + * + * @param {string} project - Project ID or project name + * @param {string} queueName - Filter on the agent queue name + * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions */ - getTaskContentZip(taskId, versionString, visibility, scopeLocal) { + getAgentQueues(project, queueName, actionFilter) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - taskId: taskId, - versionString: versionString + project: project }; let queryValues = { - visibility: visibility, - scopeLocal: scopeLocal, + queueName: queueName, + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, true); + resolve(ret); } catch (err) { reject(err); @@ -24940,29 +26761,32 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} taskId - * @param {string} versionString - * @param {string[]} visibility - * @param {boolean} scopeLocal + * Get a list of agent queues by their IDs + * + * @param {number[]} queueIds - A comma-separated list of agent queue IDs to retrieve + * @param {string} project - Project ID or project name + * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions */ - getTaskDefinition(taskId, versionString, visibility, scopeLocal) { + getAgentQueuesByIds(queueIds, project, actionFilter) { return __awaiter(this, void 0, void 0, function* () { + if (queueIds == null) { + throw new TypeError('queueIds can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - taskId: taskId, - versionString: versionString + project: project }; let queryValues = { - visibility: visibility, - scopeLocal: scopeLocal, + queueIds: queueIds && queueIds.join(","), + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskDefinition, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, true); resolve(ret); } catch (err) { @@ -24972,29 +26796,32 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} taskId - * @param {string[]} visibility - * @param {boolean} scopeLocal - * @param {boolean} allVersions + * Get a list of agent queues by their names + * + * @param {string[]} queueNames - A comma-separated list of agent names to retrieve + * @param {string} project - Project ID or project name + * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions */ - getTaskDefinitions(taskId, visibility, scopeLocal, allVersions) { + getAgentQueuesByNames(queueNames, project, actionFilter) { return __awaiter(this, void 0, void 0, function* () { + if (queueNames == null) { + throw new TypeError('queueNames can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - taskId: taskId + project: project }; let queryValues = { - visibility: visibility, - scopeLocal: scopeLocal, - allVersions: allVersions, + queueNames: queueNames && queueNames.join(","), + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskDefinition, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, true); resolve(ret); } catch (err) { @@ -25004,30 +26831,32 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {number} poolId - * @param {number} agentId - * @param {string} currentState + * Get a list of agent queues by pool ids + * + * @param {number[]} poolIds - A comma-separated list of pool ids to get the corresponding queues for + * @param {string} project - Project ID or project name + * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - Filter by whether the calling user has use or manage permissions */ - updateAgentUpdateState(poolId, agentId, currentState) { + getAgentQueuesForPools(poolIds, project, actionFilter) { return __awaiter(this, void 0, void 0, function* () { - if (currentState == null) { - throw new TypeError('currentState can not be null or undefined'); + if (poolIds == null) { + throw new TypeError('poolIds can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - agentId: agentId + project: project }; let queryValues = { - currentState: currentState, + poolIds: poolIds && poolIds.join(","), + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "8cc1b02b-ae49-4516-b5ad-4f9b29967c30", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "900fa995-c559-4923-aae7-f8424fe4fbea", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, null, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentQueue, true); resolve(ret); } catch (err) { @@ -25037,24 +26866,21 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {{ [key: string] : string; }} userCapabilities - * @param {number} poolId - * @param {number} agentId + * @param {number} agentCloudId */ - updateAgentUserCapabilities(userCapabilities, poolId, agentId) { + getAgentCloudRequests(agentCloudId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - poolId: poolId, - agentId: agentId + agentCloudId: agentCloudId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "30ba3ada-fedf-4da8-bbb5-dacf2f82e176", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "20189bd7-5134-49c2-b8e9-f9e856eea2b2", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, userCapabilities, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentCloudRequest, true); resolve(ret); } catch (err) { @@ -25064,21 +26890,18 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Add a variable group. - * - * @param {TaskAgentInterfaces.VariableGroupParameters} variableGroupParameters */ - addVariableGroup(variableGroupParameters) { + getResourceLimits() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "1f1f0557-c445-42a6-b4a0-0df605a3a0f8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, variableGroupParameters, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VariableGroup, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -25088,30 +26911,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Delete a variable group - * - * @param {number} groupId - Id of the variable group. - * @param {string[]} projectIds + * @param {string} parallelismTag + * @param {boolean} poolIsHosted + * @param {boolean} includeRunningRequests */ - deleteVariableGroup(groupId, projectIds) { + getResourceUsage(parallelismTag, poolIsHosted, includeRunningRequests) { return __awaiter(this, void 0, void 0, function* () { - if (projectIds == null) { - throw new TypeError('projectIds can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - groupId: groupId - }; + let routeValues = {}; let queryValues = { - projectIds: projectIds && projectIds.join(","), + parallelismTag: parallelismTag, + poolIsHosted: poolIsHosted, + includeRunningRequests: includeRunningRequests, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "eae1d376-a8b1-4475-9041-1dfdbe8f0143", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.ResourceUsage, false); resolve(ret); } catch (err) { @@ -25121,28 +26940,23 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Add a variable group. - * - * @param {TaskAgentInterfaces.VariableGroupProjectReference[]} variableGroupProjectReferences - * @param {number} variableGroupId + * @param {string} project - Project ID or project name + * @param {string} taskGroupId */ - shareVariableGroup(variableGroupProjectReferences, variableGroupId) { + getTaskGroupHistory(project, taskGroupId) { return __awaiter(this, void 0, void 0, function* () { - if (variableGroupId == null) { - throw new TypeError('variableGroupId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - variableGroupId: variableGroupId, + let routeValues = { + project: project, + taskGroupId: taskGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "100cc92a-b255-47fa-9ab3-e44a2985a3ac", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, variableGroupProjectReferences, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroupRevision, true); resolve(ret); } catch (err) { @@ -25152,24 +26966,25 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Update a variable group. + * Delete a secure file * - * @param {TaskAgentInterfaces.VariableGroupParameters} variableGroupParameters - * @param {number} groupId - Id of the variable group to update. + * @param {string} project - Project ID or project name + * @param {string} secureFileId - The unique secure file Id */ - updateVariableGroup(variableGroupParameters, groupId) { + deleteSecureFile(project, secureFileId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - groupId: groupId + project: project, + secureFileId: secureFileId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, variableGroupParameters, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VariableGroup, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -25179,27 +26994,34 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get a variable group. + * Download a secure file by Id * * @param {string} project - Project ID or project name - * @param {number} groupId - Id of the variable group. + * @param {string} secureFileId - The unique secure file Id + * @param {string} ticket - A valid download ticket + * @param {boolean} download - If download is true, the file is sent as attachement in the response body. If download is false, the response body contains the file stream. */ - getVariableGroup(project, groupId) { + downloadSecureFile(project, secureFileId, ticket, download) { return __awaiter(this, void 0, void 0, function* () { + if (ticket == null) { + throw new TypeError('ticket can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - groupId: groupId + secureFileId: secureFileId + }; + let queryValues = { + ticket: ticket, + download: download, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "f5b09dd5-9d54-45a1-8b5a-1c8287d634cc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VariableGroup, false); - resolve(ret); - } + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); + } catch (err) { reject(err); } @@ -25207,35 +27029,31 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get variable groups. + * Get a secure file * * @param {string} project - Project ID or project name - * @param {string} groupName - Name of variable group. - * @param {TaskAgentInterfaces.VariableGroupActionFilter} actionFilter - Action filter for the variable group. It specifies the action which can be performed on the variable groups. - * @param {number} top - Number of variable groups to get. - * @param {number} continuationToken - Gets the variable groups after the continuation token provided. - * @param {TaskAgentInterfaces.VariableGroupQueryOrder} queryOrder - Gets the results in the defined order. Default is 'IdDescending'. + * @param {string} secureFileId - The unique secure file Id + * @param {boolean} includeDownloadTicket - If includeDownloadTicket is true and the caller has permissions, a download ticket is included in the response. + * @param {TaskAgentInterfaces.SecureFileActionFilter} actionFilter */ - getVariableGroups(project, groupName, actionFilter, top, continuationToken, queryOrder) { + getSecureFile(project, secureFileId, includeDownloadTicket, actionFilter) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + secureFileId: secureFileId }; let queryValues = { - groupName: groupName, + includeDownloadTicket: includeDownloadTicket, actionFilter: actionFilter, - '$top': top, - continuationToken: continuationToken, - queryOrder: queryOrder, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "f5b09dd5-9d54-45a1-8b5a-1c8287d634cc", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VariableGroup, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, false); resolve(ret); } catch (err) { @@ -25245,30 +27063,31 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * Get variable groups by ids. + * Get secure files * * @param {string} project - Project ID or project name - * @param {number[]} groupIds - Comma separated list of Ids of variable groups. + * @param {string} namePattern - Name of the secure file to match. Can include wildcards to match multiple files. + * @param {boolean} includeDownloadTickets - If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response. + * @param {TaskAgentInterfaces.SecureFileActionFilter} actionFilter - Filter by secure file permissions for View, Manage or Use action. Defaults to View. */ - getVariableGroupsById(project, groupIds) { + getSecureFiles(project, namePattern, includeDownloadTickets, actionFilter) { return __awaiter(this, void 0, void 0, function* () { - if (groupIds == null) { - throw new TypeError('groupIds can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; let queryValues = { - groupIds: groupIds && groupIds.join(","), + namePattern: namePattern, + includeDownloadTickets: includeDownloadTickets, + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "f5b09dd5-9d54-45a1-8b5a-1c8287d634cc", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VariableGroup, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, true); resolve(ret); } catch (err) { @@ -25278,24 +27097,34 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.VirtualMachineGroupCreateParameters} createParameters + * Get secure files + * * @param {string} project - Project ID or project name - * @param {number} environmentId + * @param {string[]} secureFileIds - A list of secure file Ids + * @param {boolean} includeDownloadTickets - If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response. + * @param {TaskAgentInterfaces.SecureFileActionFilter} actionFilter */ - addVirtualMachineGroup(createParameters, project, environmentId) { + getSecureFilesByIds(project, secureFileIds, includeDownloadTickets, actionFilter) { return __awaiter(this, void 0, void 0, function* () { + if (secureFileIds == null) { + throw new TypeError('secureFileIds can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - environmentId: environmentId + project: project + }; + let queryValues = { + secureFileIds: secureFileIds && secureFileIds.join(","), + includeDownloadTickets: includeDownloadTickets, + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "9e597901-4af7-4cc3-8d92-47d54db8ebfb", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, createParameters, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VirtualMachineGroup, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, true); resolve(ret); } catch (err) { @@ -25305,25 +27134,34 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * Get secure files + * * @param {string} project - Project ID or project name - * @param {number} environmentId - * @param {number} resourceId + * @param {string[]} secureFileNames - A list of secure file Ids + * @param {boolean} includeDownloadTickets - If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response. + * @param {TaskAgentInterfaces.SecureFileActionFilter} actionFilter */ - deleteVirtualMachineGroup(project, environmentId, resourceId) { + getSecureFilesByNames(project, secureFileNames, includeDownloadTickets, actionFilter) { return __awaiter(this, void 0, void 0, function* () { + if (secureFileNames == null) { + throw new TypeError('secureFileNames can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - environmentId: environmentId, - resourceId: resourceId + project: project + }; + let queryValues = { + secureFileNames: secureFileNames && secureFileNames.join(","), + includeDownloadTickets: includeDownloadTickets, + actionFilter: actionFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "9e597901-4af7-4cc3-8d92-47d54db8ebfb", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, true); resolve(ret); } catch (err) { @@ -25333,25 +27171,28 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * Query secure files using a name pattern and a condition on file properties. + * + * @param {string} condition - The main condition syntax is described [here](https://go.microsoft.com/fwlink/?linkid=842996). Use the *property('property-name')* function to access the value of the specified property of a secure file. It returns null if the property is not set. E.g. ``` and( eq( property('devices'), '2' ), in( property('provisioning profile type'), 'ad hoc', 'development' ) ) ``` * @param {string} project - Project ID or project name - * @param {number} environmentId - * @param {number} resourceId + * @param {string} namePattern - Name of the secure file to match. Can include wildcards to match multiple files. */ - getVirtualMachineGroup(project, environmentId, resourceId) { + querySecureFilesByProperties(condition, project, namePattern) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - environmentId: environmentId, - resourceId: resourceId + project: project + }; + let queryValues = { + namePattern: namePattern, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "9e597901-4af7-4cc3-8d92-47d54db8ebfb", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VirtualMachineGroup, false); + res = yield this.rest.create(url, condition, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, true); resolve(ret); } catch (err) { @@ -25361,24 +27202,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.VirtualMachineGroup} resource + * Update the name or properties of an existing secure file + * + * @param {TaskAgentInterfaces.SecureFile} secureFile - The secure file with updated name and/or properties * @param {string} project - Project ID or project name - * @param {number} environmentId + * @param {string} secureFileId - The unique secure file Id */ - updateVirtualMachineGroup(resource, project, environmentId) { + updateSecureFile(secureFile, project, secureFileId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - environmentId: environmentId + secureFileId: secureFileId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "9e597901-4af7-4cc3-8d92-47d54db8ebfb", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, resource, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VirtualMachineGroup, false); + res = yield this.rest.update(url, secureFile, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, false); resolve(ret); } catch (err) { @@ -25388,37 +27231,24 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * Update properties and/or names of a set of secure files. Files are identified by their IDs. Properties provided override the existing one entirely, i.e. do not merge. + * + * @param {TaskAgentInterfaces.SecureFile[]} secureFiles - A list of secure file objects. Only three field must be populated Id, Name, and Properties. The rest of fields in the object are ignored. * @param {string} project - Project ID or project name - * @param {number} environmentId - * @param {number} resourceId - * @param {string} continuationToken - * @param {string} name - * @param {boolean} partialNameMatch - * @param {string[]} tags - * @param {number} top */ - getVirtualMachines(project, environmentId, resourceId, continuationToken, name, partialNameMatch, tags, top) { + updateSecureFiles(secureFiles, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - environmentId: environmentId, - resourceId: resourceId - }; - let queryValues = { - continuationToken: continuationToken, - name: name, - partialNameMatch: partialNameMatch, - tags: tags && tags.join(","), - '$top': top, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "48700676-2ba5-4282-8ec8-083280d169c7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VirtualMachine, true); + res = yield this.rest.update(url, secureFiles, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, true); resolve(ret); } catch (err) { @@ -25428,26 +27258,36 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.VirtualMachine[]} machines + * Upload a secure file, include the file stream in the request body + * + * @param {NodeJS.ReadableStream} contentStream - Content to upload * @param {string} project - Project ID or project name - * @param {number} environmentId - * @param {number} resourceId + * @param {string} name - Name of the file to upload + * @param {boolean} authorizePipelines - If authorizePipelines is true, then the secure file is authorized for use by all pipelines in the project. */ - updateVirtualMachines(machines, project, environmentId, resourceId) { + uploadSecureFile(customHeaders, contentStream, project, name, authorizePipelines) { return __awaiter(this, void 0, void 0, function* () { + if (name == null) { + throw new TypeError('name can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - environmentId: environmentId, - resourceId: resourceId + project: project }; + let queryValues = { + name: name, + authorizePipelines: authorizePipelines, + }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "48700676-2ba5-4282-8ec8-083280d169c7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "adcfd8bc-b184-43ba-bd84-7c8c6a2ff421", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.update(url, machines, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VirtualMachine, true); + res = yield this.rest.uploadStream("POST", url, contentStream, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.SecureFile, false); resolve(ret); } catch (err) { @@ -25457,19 +27297,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.AadOauthTokenRequest} authenticationRequest + * @param {TaskAgentInterfaces.TaskAgentSession} session + * @param {number} poolId */ - acquireAccessToken(authenticationRequest) { + createAgentSession(session, poolId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + poolId: poolId + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "9c63205e-3a0f-42a0-ad88-095200f13607", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "134e239e-2df3-4794-a6f6-24f1f19ec8dc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, authenticationRequest, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, session, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentSession, false); resolve(ret); } catch (err) { @@ -25479,35 +27322,22 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * @param {string} tenantId - * @param {string} redirectUri - * @param {TaskAgentInterfaces.AadLoginPromptOption} promptOption - * @param {string} completeCallbackPayload - * @param {boolean} completeCallbackByAuthCode + * @param {number} poolId + * @param {string} sessionId */ - createAadOAuthRequest(tenantId, redirectUri, promptOption, completeCallbackPayload, completeCallbackByAuthCode) { + deleteAgentSession(poolId, sessionId) { return __awaiter(this, void 0, void 0, function* () { - if (tenantId == null) { - throw new TypeError('tenantId can not be null or undefined'); - } - if (redirectUri == null) { - throw new TypeError('redirectUri can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - tenantId: tenantId, - redirectUri: redirectUri, - promptOption: promptOption, - completeCallbackPayload: completeCallbackPayload, - completeCallbackByAuthCode: completeCallbackByAuthCode, + let routeValues = { + poolId: poolId, + sessionId: sessionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "9c63205e-3a0f-42a0-ad88-095200f13607", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "134e239e-2df3-4794-a6f6-24f1f19ec8dc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -25518,18 +27348,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** + * Register a deployment target to a deployment group. Generally this is called by agent configuration tool. + * + * @param {TaskAgentInterfaces.DeploymentMachine} machine - Deployment target to register. + * @param {string} project - Project ID or project name + * @param {number} deploymentGroupId - ID of the deployment group to which the deployment target is registered. */ - getVstsAadTenantId() { + addDeploymentTarget(machine, project, deploymentGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + deploymentGroupId: deploymentGroupId + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "9c63205e-3a0f-42a0-ad88-095200f13607", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, machine, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); resolve(ret); } catch (err) { @@ -25539,23 +27377,26 @@ class TaskAgentApiBase extends basem.ClientApiBase { }); } /** - * GET the Yaml schema used for Yaml file validation. + * Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too. * - * @param {boolean} validateTaskNames - Whether the schema should validate that tasks are actually installed (useful for offline tools where you don't want validation). + * @param {string} project - Project ID or project name + * @param {number} deploymentGroupId - ID of the deployment group in which deployment target is deleted. + * @param {number} targetId - ID of the deployment target to delete. */ - getYamlSchema(validateTaskNames) { + deleteDeploymentTarget(project, deploymentGroupId, targetId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - validateTaskNames: validateTaskNames, + let routeValues = { + project: project, + deploymentGroupId: deploymentGroupId, + targetId: targetId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "1f9990b9-1dba-441f-9c2e-6485888c42b6", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -25565,64 +27406,32 @@ class TaskAgentApiBase extends basem.ClientApiBase { })); }); } -} -TaskAgentApiBase.RESOURCE_AREA_ID = "a85b8835-c1a1-4aac-ae97-1c3d0ba72dbd"; -exports.TaskAgentApiBase = TaskAgentApiBase; - - -/***/ }), - -/***/ 2354: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const TaskAgentInterfaces = __nccwpck_require__(9565); -class TaskApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Task-api', options); - } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} type + * Get a deployment target by its ID in a deployment group + * + * @param {string} project - Project ID or project name + * @param {number} deploymentGroupId - ID of the deployment group to which deployment target belongs. + * @param {number} targetId - ID of the deployment target to return. + * @param {TaskAgentInterfaces.DeploymentTargetExpands} expand - Include these additional details in the returned objects. */ - getPlanAttachments(scopeIdentifier, hubName, planId, type) { + getDeploymentTarget(project, deploymentGroupId, targetId, expand) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - type: type + project: project, + deploymentGroupId: deploymentGroupId, + targetId: targetId + }; + let queryValues = { + '$expand': expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "eb55e5d6-2f30-4295-b5ed-38da50b1fc52", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAttachment, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); resolve(ret); } catch (err) { @@ -25632,37 +27441,47 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {NodeJS.ReadableStream} contentStream - Content to upload - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param {string} name + * Get a list of deployment targets in a deployment group. + * + * @param {string} project - Project ID or project name + * @param {number} deploymentGroupId - ID of the deployment group. + * @param {string[]} tags - Get only the deployment targets that contain all these comma separted list of tags. + * @param {string} name - Name pattern of the deployment targets to return. + * @param {boolean} partialNameMatch - When set to true, treats **name** as pattern. Else treats it as absolute match. Default is **false**. + * @param {TaskAgentInterfaces.DeploymentTargetExpands} expand - Include these additional details in the returned objects. + * @param {TaskAgentInterfaces.TaskAgentStatusFilter} agentStatus - Get only deployment targets that have this status. + * @param {TaskAgentInterfaces.TaskAgentJobResultFilter} agentJobResult - Get only deployment targets that have this last job result. + * @param {string} continuationToken - Get deployment targets with names greater than this continuationToken lexicographically. + * @param {number} top - Maximum number of deployment targets to return. Default is **1000**. + * @param {boolean} enabled - Get only deployment targets that are enabled or disabled. Default is 'null' which returns all the targets. + * @param {string[]} propertyFilters */ - createAttachment(customHeaders, contentStream, scopeIdentifier, hubName, planId, timelineId, recordId, type, name) { + getDeploymentTargets(project, deploymentGroupId, tags, name, partialNameMatch, expand, agentStatus, agentJobResult, continuationToken, top, enabled, propertyFilters) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId, - recordId: recordId, - type: type, - name: name + project: project, + deploymentGroupId: deploymentGroupId + }; + let queryValues = { + tags: tags && tags.join(","), + name: name, + partialNameMatch: partialNameMatch, + '$expand': expand, + agentStatus: agentStatus, + agentJobResult: agentJobResult, + continuationToken: continuationToken, + '$top': top, + enabled: enabled, + propertyFilters: propertyFilters && propertyFilters.join(","), }; - customHeaders = customHeaders || {}; - customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "7898f959-9cdf-4096-b29e-7f293031629e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); - options.additionalHeaders = customHeaders; let res; - res = yield this.rest.uploadStream("PUT", url, contentStream, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAttachment, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); resolve(ret); } catch (err) { @@ -25672,45 +27491,28 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param {string} name - * @param {string} artifactHash - * @param {number} length + * Replace a deployment target in a deployment group. Generally this is called by agent configuration tool. + * + * @param {TaskAgentInterfaces.DeploymentMachine} machine - New deployment target. + * @param {string} project - Project ID or project name + * @param {number} deploymentGroupId - ID of the deployment group in which deployment target is replaced. + * @param {number} targetId - ID of the deployment target to replace. */ - createAttachmentFromArtifact(scopeIdentifier, hubName, planId, timelineId, recordId, type, name, artifactHash, length) { + replaceDeploymentTarget(machine, project, deploymentGroupId, targetId) { return __awaiter(this, void 0, void 0, function* () { - if (artifactHash == null) { - throw new TypeError('artifactHash can not be null or undefined'); - } - if (length == null) { - throw new TypeError('length can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId, - recordId: recordId, - type: type, - name: name - }; - let queryValues = { - artifactHash: artifactHash, - length: length, + project: project, + deploymentGroupId: deploymentGroupId, + targetId: targetId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "7898f959-9cdf-4096-b29e-7f293031629e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, null, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAttachment, false); + res = yield this.rest.replace(url, machine, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); resolve(ret); } catch (err) { @@ -25720,33 +27522,28 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param {string} name + * Update a deployment target and its agent properties in a deployment group. Generally this is called by agent configuration tool. + * + * @param {TaskAgentInterfaces.DeploymentMachine} machine - Deployment target to update. + * @param {string} project - Project ID or project name + * @param {number} deploymentGroupId - ID of the deployment group in which deployment target is updated. + * @param {number} targetId - ID of the deployment target to update. */ - getAttachment(scopeIdentifier, hubName, planId, timelineId, recordId, type, name) { + updateDeploymentTarget(machine, project, deploymentGroupId, targetId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId, - recordId: recordId, - type: type, - name: name + project: project, + deploymentGroupId: deploymentGroupId, + targetId: targetId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "7898f959-9cdf-4096-b29e-7f293031629e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAttachment, false); + res = yield this.rest.update(url, machine, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, false); resolve(ret); } catch (err) { @@ -25756,32 +27553,27 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param {string} name + * Update tags of a list of deployment targets in a deployment group. + * + * @param {TaskAgentInterfaces.DeploymentTargetUpdateParameter[]} machines - Deployment targets with tags to udpdate. + * @param {string} project - Project ID or project name + * @param {number} deploymentGroupId - ID of the deployment group in which deployment targets are updated. */ - getAttachmentContent(scopeIdentifier, hubName, planId, timelineId, recordId, type, name) { + updateDeploymentTargets(machines, project, deploymentGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId, - recordId: recordId, - type: type, - name: name + project: project, + deploymentGroupId: deploymentGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "7898f959-9cdf-4096-b29e-7f293031629e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "2f0aa599-c121-4256-a5fd-ba370e0ae7b6", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, machines, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.DeploymentMachine, true); + resolve(ret); } catch (err) { reject(err); @@ -25790,31 +27582,24 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type + * Create a task group. + * + * @param {TaskAgentInterfaces.TaskGroupCreateParameter} taskGroup - Task group object to create. + * @param {string} project - Project ID or project name */ - getAttachments(scopeIdentifier, hubName, planId, timelineId, recordId, type) { + addTaskGroup(taskGroup, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId, - recordId: recordId, - type: type + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "7898f959-9cdf-4096-b29e-7f293031629e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAttachment, true); + res = yield this.rest.create(url, taskGroup, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, false); resolve(ret); } catch (err) { @@ -25824,29 +27609,28 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TimelineRecordFeedLinesWrapper} lines - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId + * Delete a task group. + * + * @param {string} project - Project ID or project name + * @param {string} taskGroupId - Id of the task group to be deleted. + * @param {string} comment - Comments to delete. */ - appendTimelineRecordFeed(lines, scopeIdentifier, hubName, planId, timelineId, recordId) { + deleteTaskGroup(project, taskGroupId, comment) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId, - recordId: recordId + project: project, + taskGroupId: taskGroupId + }; + let queryValues = { + comment: comment, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "858983e4-19bd-4c5e-864c-507b59b58b12", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, lines, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -25857,42 +27641,34 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} stepId - * @param {number} endLine - * @param {number} takeCount - * @param {string} continuationToken - */ - getLines(scopeIdentifier, hubName, planId, timelineId, recordId, stepId, endLine, takeCount, continuationToken) { - return __awaiter(this, void 0, void 0, function* () { - if (stepId == null) { - throw new TypeError('stepId can not be null or undefined'); + * Get task group. + * + * @param {string} project - Project ID or project name + * @param {string} taskGroupId - Id of the task group. + * @param {string} versionSpec - version specification of the task group. examples: 1, 1.0. + * @param {TaskAgentInterfaces.TaskGroupExpands} expand - The properties that should be expanded. example $expand=Tasks will expand nested task groups. + */ + getTaskGroup(project, taskGroupId, versionSpec, expand) { + return __awaiter(this, void 0, void 0, function* () { + if (versionSpec == null) { + throw new TypeError('versionSpec can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId, - recordId: recordId + project: project, + taskGroupId: taskGroupId }; let queryValues = { - stepId: stepId, - endLine: endLine, - takeCount: takeCount, - continuationToken: continuationToken, + versionSpec: versionSpec, + '$expand': expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "858983e4-19bd-4c5e-864c-507b59b58b12", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, false); resolve(ret); } catch (err) { @@ -25902,26 +27678,29 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} orchestrationId + * @param {string} project - Project ID or project name + * @param {string} taskGroupId + * @param {number} revision */ - getJobInstance(scopeIdentifier, hubName, orchestrationId) { + getTaskGroupRevision(project, taskGroupId, revision) { return __awaiter(this, void 0, void 0, function* () { + if (revision == null) { + throw new TypeError('revision can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - orchestrationId: orchestrationId + project: project, + taskGroupId: taskGroupId + }; + let queryValues = { + revision: revision, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "0a1efd25-abda-43bd-9629-6c7bdd2e0d60", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJob, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -25930,31 +27709,39 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {NodeJS.ReadableStream} contentStream - Content to upload - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {number} logId + * List task groups. + * + * @param {string} project - Project ID or project name + * @param {string} taskGroupId - Id of the task group. + * @param {boolean} expanded - 'true' to recursively expand task groups. Default is 'false'. + * @param {string} taskIdFilter - Guid of the taskId to filter. + * @param {boolean} deleted - 'true'to include deleted task groups. Default is 'false'. + * @param {number} top - Number of task groups to get. + * @param {Date} continuationToken - Gets the task groups after the continuation token provided. + * @param {TaskAgentInterfaces.TaskGroupQueryOrder} queryOrder - Gets the results in the defined order. Default is 'CreatedOnDescending'. */ - appendLogContent(customHeaders, contentStream, scopeIdentifier, hubName, planId, logId) { + getTaskGroups(project, taskGroupId, expanded, taskIdFilter, deleted, top, continuationToken, queryOrder) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - logId: logId + project: project, + taskGroupId: taskGroupId + }; + let queryValues = { + expanded: expanded, + taskIdFilter: taskIdFilter, + deleted: deleted, + '$top': top, + continuationToken: continuationToken, + queryOrder: queryOrder, }; - customHeaders = customHeaders || {}; - customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "46f5667d-263a-4684-91b1-dff7fdcf64e2", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); - options.additionalHeaders = customHeaders; let res; - res = yield this.rest.uploadStream("POST", url, contentStream, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskLog, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, true); resolve(ret); } catch (err) { @@ -25964,39 +27751,29 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {number} logId - * @param {string} serializedBlobId - * @param {number} lineCount + * @param {TaskAgentInterfaces.PublishTaskGroupMetadata} taskGroupMetadata + * @param {string} project - Project ID or project name + * @param {string} parentTaskGroupId */ - associateLog(scopeIdentifier, hubName, planId, logId, serializedBlobId, lineCount) { + publishTaskGroup(taskGroupMetadata, project, parentTaskGroupId) { return __awaiter(this, void 0, void 0, function* () { - if (serializedBlobId == null) { - throw new TypeError('serializedBlobId can not be null or undefined'); - } - if (lineCount == null) { - throw new TypeError('lineCount can not be null or undefined'); + if (parentTaskGroupId == null) { + throw new TypeError('parentTaskGroupId can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - logId: logId + project: project }; let queryValues = { - serializedBlobId: serializedBlobId, - lineCount: lineCount, + parentTaskGroupId: parentTaskGroupId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "46f5667d-263a-4684-91b1-dff7fdcf64e2", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskLog, false); + res = yield this.rest.replace(url, taskGroupMetadata, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, true); resolve(ret); } catch (err) { @@ -26006,26 +27783,22 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.TaskLog} log - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId + * @param {TaskAgentInterfaces.TaskGroup} taskGroup + * @param {string} project - Project ID or project name */ - createLog(log, scopeIdentifier, hubName, planId) { + undeleteTaskGroup(taskGroup, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "46f5667d-263a-4684-91b1-dff7fdcf64e2", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, log, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskLog, false); + res = yield this.rest.update(url, taskGroup, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, true); resolve(ret); } catch (err) { @@ -26035,33 +27808,26 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {number} logId - * @param {number} startLine - * @param {number} endLine + * Update a task group. + * + * @param {TaskAgentInterfaces.TaskGroupUpdateParameter} taskGroup - Task group to update. + * @param {string} project - Project ID or project name + * @param {string} taskGroupId - Id of the task group to update. */ - getLog(scopeIdentifier, hubName, planId, logId, startLine, endLine) { + updateTaskGroup(taskGroup, project, taskGroupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - logId: logId - }; - let queryValues = { - startLine: startLine, - endLine: endLine, + project: project, + taskGroupId: taskGroupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "46f5667d-263a-4684-91b1-dff7fdcf64e2", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.replace(url, taskGroup, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, false); resolve(ret); } catch (err) { @@ -26071,25 +27837,28 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId + * @param {TaskAgentInterfaces.TaskGroupUpdatePropertiesBase} taskGroupUpdateProperties + * @param {string} project - Project ID or project name + * @param {string} taskGroupId + * @param {boolean} disablePriorVersions */ - getLogs(scopeIdentifier, hubName, planId) { + updateTaskGroupProperties(taskGroupUpdateProperties, project, taskGroupId, disablePriorVersions) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId + project: project, + taskGroupId: taskGroupId + }; + let queryValues = { + disablePriorVersions: disablePriorVersions, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "46f5667d-263a-4684-91b1-dff7fdcf64e2", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskLog, true); + res = yield this.rest.update(url, taskGroupUpdateProperties, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskGroup, true); resolve(ret); } catch (err) { @@ -26099,23 +27868,21 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server + * @param {string} taskId */ - getPlanGroupsQueueMetrics(scopeIdentifier, hubName) { + deleteTaskDefinition(taskId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName + taskId: taskId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "038fd4d5-cda7-44ca-92c0-935843fee1a7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskOrchestrationPlanGroupsQueueMetrics, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -26125,30 +27892,31 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {TaskAgentInterfaces.PlanGroupStatus} statusFilter - * @param {number} count + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal */ - getQueuedPlanGroups(scopeIdentifier, hubName, statusFilter, count) { + getTaskContentZip(taskId, versionString, visibility, scopeLocal) { return __awaiter(this, void 0, void 0, function* () { + if (versionString == null) { + throw new TypeError('versionString can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName + taskId: taskId }; let queryValues = { - statusFilter: statusFilter, - count: count, + versionString: versionString, + visibility: visibility, + scopeLocal: scopeLocal, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "0dd73091-3e36-4f43-b443-1b76dd426d84", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskOrchestrationQueuedPlanGroup, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -26157,25 +27925,32 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planGroup + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal */ - getQueuedPlanGroup(scopeIdentifier, hubName, planGroup) { + getTaskDefinition(taskId, versionString, visibility, scopeLocal) { return __awaiter(this, void 0, void 0, function* () { + if (versionString == null) { + throw new TypeError('versionString can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planGroup: planGroup + taskId: taskId + }; + let queryValues = { + versionString: versionString, + visibility: visibility, + scopeLocal: scopeLocal, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "65fd0708-bc1e-447b-a731-0587c5464e5b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskOrchestrationQueuedPlanGroup, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskDefinition, false); resolve(ret); } catch (err) { @@ -26185,25 +27960,29 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId + * @param {string} taskId + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @param {boolean} allVersions */ - getPlan(scopeIdentifier, hubName, planId) { + getTaskDefinitions(taskId, visibility, scopeLocal, allVersions) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId + taskId: taskId + }; + let queryValues = { + visibility: visibility, + scopeLocal: scopeLocal, + allVersions: allVersions, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "distributedtask", "5cecd946-d704-471e-a45f-3b4064fcfaba", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "60aac929-f0cd-4bc8-9ce4-6b30e8f1b1bd", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskOrchestrationPlan, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskDefinition, true); resolve(ret); } catch (err) { @@ -26213,31 +27992,30 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {number} changeId + * @param {number} poolId + * @param {number} agentId + * @param {string} currentState */ - getRecords(scopeIdentifier, hubName, planId, timelineId, changeId) { + updateAgentUpdateState(poolId, agentId, currentState) { return __awaiter(this, void 0, void 0, function* () { + if (currentState == null) { + throw new TypeError('currentState can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId + poolId: poolId, + agentId: agentId }; let queryValues = { - changeId: changeId, + currentState: currentState, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "8893bc5b-35b2-4be7-83cb-99e683551db4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "8cc1b02b-ae49-4516-b5ad-4f9b29967c30", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TimelineRecord, true); + res = yield this.rest.replace(url, null, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); resolve(ret); } catch (err) { @@ -26247,28 +28025,24 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {VSSInterfaces.VssJsonCollectionWrapperV} records - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId + * @param {{ [key: string] : string; }} userCapabilities + * @param {number} poolId + * @param {number} agentId */ - updateRecords(records, scopeIdentifier, hubName, planId, timelineId) { + updateAgentUserCapabilities(userCapabilities, poolId, agentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId + poolId: poolId, + agentId: agentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "8893bc5b-35b2-4be7-83cb-99e683551db4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "30ba3ada-fedf-4da8-bbb5-dacf2f82e176", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, records, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TimelineRecord, true); + res = yield this.rest.replace(url, userCapabilities, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgent, false); resolve(ret); } catch (err) { @@ -26278,26 +28052,21 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {TaskAgentInterfaces.Timeline} timeline - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId + * Add a variable group. + * + * @param {TaskAgentInterfaces.VariableGroupParameters} variableGroupParameters */ - createTimeline(timeline, scopeIdentifier, hubName, planId) { + addVariableGroup(variableGroupParameters) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "83597576-cc2c-453c-bea6-2882ae6a1653", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, timeline, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.Timeline, false); + res = yield this.rest.create(url, variableGroupParameters, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VariableGroup, false); resolve(ret); } catch (err) { @@ -26307,22 +28076,25 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId + * Delete a variable group + * + * @param {number} groupId - Id of the variable group. + * @param {string[]} projectIds */ - deleteTimeline(scopeIdentifier, hubName, planId, timelineId) { + deleteVariableGroup(groupId, projectIds) { return __awaiter(this, void 0, void 0, function* () { + if (projectIds == null) { + throw new TypeError('projectIds can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId + groupId: groupId + }; + let queryValues = { + projectIds: projectIds && projectIds.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "83597576-cc2c-453c-bea6-2882ae6a1653", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -26337,33 +28109,28 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {number} changeId - * @param {boolean} includeRecords + * Add a variable group. + * + * @param {TaskAgentInterfaces.VariableGroupProjectReference[]} variableGroupProjectReferences + * @param {number} variableGroupId */ - getTimeline(scopeIdentifier, hubName, planId, timelineId, changeId, includeRecords) { + shareVariableGroup(variableGroupProjectReferences, variableGroupId) { return __awaiter(this, void 0, void 0, function* () { + if (variableGroupId == null) { + throw new TypeError('variableGroupId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId, - timelineId: timelineId - }; + let routeValues = {}; let queryValues = { - changeId: changeId, - includeRecords: includeRecords, + variableGroupId: variableGroupId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "83597576-cc2c-453c-bea6-2882ae6a1653", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.Timeline, false); + res = yield this.rest.update(url, variableGroupProjectReferences, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -26373,25 +28140,24 @@ class TaskApi extends basem.ClientApiBase { }); } /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId + * Update a variable group. + * + * @param {TaskAgentInterfaces.VariableGroupParameters} variableGroupParameters + * @param {number} groupId - Id of the variable group to update. */ - getTimelines(scopeIdentifier, hubName, planId) { + updateVariableGroup(variableGroupParameters, groupId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - scopeIdentifier: scopeIdentifier, - hubName: hubName, - planId: planId + groupId: groupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "distributedtask", "83597576-cc2c-453c-bea6-2882ae6a1653", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.Timeline, true); + res = yield this.rest.replace(url, variableGroupParameters, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VariableGroup, false); resolve(ret); } catch (err) { @@ -26400,73 +28166,26 @@ class TaskApi extends basem.ClientApiBase { })); }); } -} -exports.TaskApi = TaskApi; - - -/***/ }), - -/***/ 5742: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const TestInterfaces = __nccwpck_require__(3047); -class TestApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Test-api', options); - } /** - * Attach a file to test step result + * Get a variable group. * - * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment details TestAttachmentRequestModel * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the result. - * @param {number} testCaseResultId - ID of the test result that contains the iteration - * @param {number} iterationId - ID of the test result iteration. - * @param {string} actionPath - Hex value of test result action path. + * @param {number} groupId - Id of the variable group. */ - createTestIterationResultAttachment(attachmentRequestModel, project, runId, testCaseResultId, iterationId, actionPath) { + getVariableGroup(project, groupId) { return __awaiter(this, void 0, void 0, function* () { - if (iterationId == null) { - throw new TypeError('iterationId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId, - testCaseResultId: testCaseResultId - }; - let queryValues = { - iterationId: iterationId, - actionPath: actionPath, + groupId: groupId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "f5b09dd5-9d54-45a1-8b5a-1c8287d634cc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, attachmentRequestModel, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VariableGroup, false); resolve(ret); } catch (err) { @@ -26476,28 +28195,35 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Attach a file to a test result. + * Get variable groups. * - * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment details TestAttachmentRequestModel * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the result. - * @param {number} testCaseResultId - ID of the test result against which attachment has to be uploaded. + * @param {string} groupName - Name of variable group. + * @param {TaskAgentInterfaces.VariableGroupActionFilter} actionFilter - Action filter for the variable group. It specifies the action which can be performed on the variable groups. + * @param {number} top - Number of variable groups to get. + * @param {number} continuationToken - Gets the variable groups after the continuation token provided. + * @param {TaskAgentInterfaces.VariableGroupQueryOrder} queryOrder - Gets the results in the defined order. Default is 'IdDescending'. */ - createTestResultAttachment(attachmentRequestModel, project, runId, testCaseResultId) { + getVariableGroups(project, groupName, actionFilter, top, continuationToken, queryOrder) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId, - testCaseResultId: testCaseResultId + project: project + }; + let queryValues = { + groupName: groupName, + actionFilter: actionFilter, + '$top': top, + continuationToken: continuationToken, + queryOrder: queryOrder, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "f5b09dd5-9d54-45a1-8b5a-1c8287d634cc", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, attachmentRequestModel, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VariableGroup, true); resolve(ret); } catch (err) { @@ -26507,35 +28233,32 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Attach a file to a test result + * Get variable groups by ids. * - * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment Request Model. * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the result. - * @param {number} testCaseResultId - ID of the test results that contains sub result. - * @param {number} testSubResultId - ID of the test sub results against which attachment has to be uploaded. + * @param {number[]} groupIds - Comma separated list of Ids of variable groups. + * @param {boolean} loadSecrets - Flag indicating if the secrets within variable groups should be loaded. */ - createTestSubResultAttachment(attachmentRequestModel, project, runId, testCaseResultId, testSubResultId) { + getVariableGroupsById(project, groupIds, loadSecrets) { return __awaiter(this, void 0, void 0, function* () { - if (testSubResultId == null) { - throw new TypeError('testSubResultId can not be null or undefined'); + if (groupIds == null) { + throw new TypeError('groupIds can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId, - testCaseResultId: testCaseResultId + project: project }; let queryValues = { - testSubResultId: testSubResultId, + groupIds: groupIds && groupIds.join(","), + loadSecrets: loadSecrets, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "f5b09dd5-9d54-45a1-8b5a-1c8287d634cc", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, attachmentRequestModel, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VariableGroup, true); resolve(ret); } catch (err) { @@ -26545,28 +28268,25 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Download a test result attachment by its ID. - * + * @param {TaskAgentInterfaces.VirtualMachineGroupCreateParameters} createParameters * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the testCaseResultId. - * @param {number} testCaseResultId - ID of the test result whose attachment has to be downloaded. - * @param {number} attachmentId - ID of the test result attachment to be downloaded. + * @param {number} environmentId */ - getTestResultAttachmentContent(project, runId, testCaseResultId, attachmentId) { + addVirtualMachineGroup(createParameters, project, environmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId, - testCaseResultId: testCaseResultId, - attachmentId: attachmentId + environmentId: environmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "9e597901-4af7-4cc3-8d92-47d54db8ebfb", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, createParameters, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VirtualMachineGroup, false); + resolve(ret); } catch (err) { reject(err); @@ -26575,27 +28295,25 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get list of test result attachments reference. - * * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the result. - * @param {number} testCaseResultId - ID of the test result. + * @param {number} environmentId + * @param {number} resourceId */ - getTestResultAttachments(project, runId, testCaseResultId) { + deleteVirtualMachineGroup(project, environmentId, resourceId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId, - testCaseResultId: testCaseResultId + environmentId: environmentId, + resourceId: resourceId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "9e597901-4af7-4cc3-8d92-47d54db8ebfb", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestAttachment, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -26605,28 +28323,26 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Download a test result attachment by its ID. - * * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the testCaseResultId. - * @param {number} testCaseResultId - ID of the test result whose attachment has to be downloaded. - * @param {number} attachmentId - ID of the test result attachment to be downloaded. + * @param {number} environmentId + * @param {number} resourceId */ - getTestResultAttachmentZip(project, runId, testCaseResultId, attachmentId) { + getVirtualMachineGroup(project, environmentId, resourceId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId, - testCaseResultId: testCaseResultId, - attachmentId: attachmentId + environmentId: environmentId, + resourceId: resourceId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "9e597901-4af7-4cc3-8d92-47d54db8ebfb", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VirtualMachineGroup, false); + resolve(ret); } catch (err) { reject(err); @@ -26635,35 +28351,25 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Download a test sub result attachment - * + * @param {TaskAgentInterfaces.VirtualMachineGroup} resource * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the result. - * @param {number} testCaseResultId - ID of the test results that contains sub result. - * @param {number} attachmentId - ID of the test result attachment to be downloaded - * @param {number} testSubResultId - ID of the test sub result whose attachment has to be downloaded + * @param {number} environmentId */ - getTestSubResultAttachmentContent(project, runId, testCaseResultId, attachmentId, testSubResultId) { + updateVirtualMachineGroup(resource, project, environmentId) { return __awaiter(this, void 0, void 0, function* () { - if (testSubResultId == null) { - throw new TypeError('testSubResultId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId, - testCaseResultId: testCaseResultId, - attachmentId: attachmentId - }; - let queryValues = { - testSubResultId: testSubResultId, + environmentId: environmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "9e597901-4af7-4cc3-8d92-47d54db8ebfb", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, resource, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VirtualMachineGroup, false); + resolve(ret); } catch (err) { reject(err); @@ -26672,34 +28378,37 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get list of test sub result attachments - * * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the result. - * @param {number} testCaseResultId - ID of the test results that contains sub result. - * @param {number} testSubResultId - ID of the test sub result whose attachment has to be downloaded + * @param {number} environmentId + * @param {number} resourceId + * @param {string} continuationToken + * @param {string} name + * @param {boolean} partialNameMatch + * @param {string[]} tags + * @param {number} top */ - getTestSubResultAttachments(project, runId, testCaseResultId, testSubResultId) { + getVirtualMachines(project, environmentId, resourceId, continuationToken, name, partialNameMatch, tags, top) { return __awaiter(this, void 0, void 0, function* () { - if (testSubResultId == null) { - throw new TypeError('testSubResultId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId, - testCaseResultId: testCaseResultId + environmentId: environmentId, + resourceId: resourceId }; let queryValues = { - testSubResultId: testSubResultId, + continuationToken: continuationToken, + name: name, + partialNameMatch: partialNameMatch, + tags: tags && tags.join(","), + '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "48700676-2ba5-4282-8ec8-083280d169c7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestAttachment, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VirtualMachine, true); resolve(ret); } catch (err) { @@ -26709,35 +28418,27 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Download a test sub result attachment - * + * @param {TaskAgentInterfaces.VirtualMachine[]} machines * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the result. - * @param {number} testCaseResultId - ID of the test results that contains sub result. - * @param {number} attachmentId - ID of the test result attachment to be downloaded - * @param {number} testSubResultId - ID of the test sub result whose attachment has to be downloaded + * @param {number} environmentId + * @param {number} resourceId */ - getTestSubResultAttachmentZip(project, runId, testCaseResultId, attachmentId, testSubResultId) { + updateVirtualMachines(machines, project, environmentId, resourceId) { return __awaiter(this, void 0, void 0, function* () { - if (testSubResultId == null) { - throw new TypeError('testSubResultId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId, - testCaseResultId: testCaseResultId, - attachmentId: attachmentId - }; - let queryValues = { - testSubResultId: testSubResultId, + environmentId: environmentId, + resourceId: resourceId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "48700676-2ba5-4282-8ec8-083280d169c7", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, machines, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.VirtualMachine, true); + resolve(ret); } catch (err) { reject(err); @@ -26746,25 +28447,35 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Attach a file to a test run. - * - * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment details TestAttachmentRequestModel - * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run against which attachment has to be uploaded. + * @param {string} tenantId + * @param {string} redirectUri + * @param {TaskAgentInterfaces.AadLoginPromptOption} promptOption + * @param {string} completeCallbackPayload + * @param {boolean} completeCallbackByAuthCode */ - createTestRunAttachment(attachmentRequestModel, project, runId) { + createAadOAuthRequest(tenantId, redirectUri, promptOption, completeCallbackPayload, completeCallbackByAuthCode) { return __awaiter(this, void 0, void 0, function* () { + if (tenantId == null) { + throw new TypeError('tenantId can not be null or undefined'); + } + if (redirectUri == null) { + throw new TypeError('redirectUri can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - runId: runId + let routeValues = {}; + let queryValues = { + tenantId: tenantId, + redirectUri: redirectUri, + promptOption: promptOption, + completeCallbackPayload: completeCallbackPayload, + completeCallbackByAuthCode: completeCallbackByAuthCode, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "9c63205e-3a0f-42a0-ad88-095200f13607", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, attachmentRequestModel, options); + res = yield this.rest.create(url, null, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -26775,26 +28486,19 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Download a test run attachment by its ID. - * - * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run whose attachment has to be downloaded. - * @param {number} attachmentId - ID of the test run attachment to be downloaded. */ - getTestRunAttachmentContent(project, runId, attachmentId) { + getVstsAadTenantId() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - runId: runId, - attachmentId: attachmentId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "9c63205e-3a0f-42a0-ad88-095200f13607", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); } catch (err) { reject(err); @@ -26803,25 +28507,24 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get list of test run attachments reference. + * GET the Yaml schema used for Yaml file validation. * - * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run. + * @param {boolean} validateTaskNames - Whether the schema should validate that tasks are actually installed (useful for offline tools where you don't want validation). */ - getTestRunAttachments(project, runId) { + getYamlSchema(validateTaskNames) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - runId: runId + let routeValues = {}; + let queryValues = { + validateTaskNames: validateTaskNames, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "1f9990b9-1dba-441f-9c2e-6485888c42b6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestAttachment, true); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -26830,27 +28533,67 @@ class TestApi extends basem.ClientApiBase { })); }); } +} +exports.TaskAgentApiBase = TaskAgentApiBase; +TaskAgentApiBase.RESOURCE_AREA_ID = "a85b8835-c1a1-4aac-ae97-1c3d0ba72dbd"; + + +/***/ }), + +/***/ 2354: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TaskApi = void 0; +const basem = __nccwpck_require__(273); +const TaskAgentInterfaces = __nccwpck_require__(9565); +class TaskApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Task-api', options); + } /** - * Download a test run attachment by its ID. - * - * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run whose attachment has to be downloaded. - * @param {number} attachmentId - ID of the test run attachment to be downloaded. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} type */ - getTestRunAttachmentZip(project, runId, attachmentId) { + getPlanAttachments(scopeIdentifier, hubName, planId, type) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId, - attachmentId: attachmentId + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + type: type }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "eb55e5d6-2f30-4295-b5ed-38da50b1fc52", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAttachment, true); + resolve(ret); } catch (err) { reject(err); @@ -26859,25 +28602,37 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId + * @param {NodeJS.ReadableStream} contentStream - Content to upload + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @param {string} name */ - getBugsLinkedToTestResult(project, runId, testCaseResultId) { + createAttachment(customHeaders, contentStream, scopeIdentifier, hubName, planId, timelineId, recordId, type, name) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId, - testCaseResultId: testCaseResultId + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId, + recordId: recordId, + type: type, + name: name }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "6de20ca2-67de-4faf-97fa-38c5d585eb00", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "7898f959-9cdf-4096-b29e-7f293031629e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.uploadStream("PUT", url, contentStream, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAttachment, false); resolve(ret); } catch (err) { @@ -26887,35 +28642,45 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get code coverage data for a build. - * - * @param {string} project - Project ID or project name - * @param {number} buildId - ID of the build for which code coverage data needs to be fetched. - * @param {number} flags - Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @param {string} name + * @param {string} artifactHash + * @param {number} length */ - getBuildCodeCoverage(project, buildId, flags) { + createAttachmentFromArtifact(scopeIdentifier, hubName, planId, timelineId, recordId, type, name, artifactHash, length) { return __awaiter(this, void 0, void 0, function* () { - if (buildId == null) { - throw new TypeError('buildId can not be null or undefined'); + if (artifactHash == null) { + throw new TypeError('artifactHash can not be null or undefined'); } - if (flags == null) { - throw new TypeError('flags can not be null or undefined'); + if (length == null) { + throw new TypeError('length can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId, + recordId: recordId, + type: type, + name: name }; let queryValues = { - buildId: buildId, - flags: flags, + artifactHash: artifactHash, + length: length, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "77560e8a-4e8c-4d59-894e-a5f264c24444", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "7898f959-9cdf-4096-b29e-7f293031629e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.BuildCoverage, true); + res = yield this.rest.replace(url, null, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAttachment, false); resolve(ret); } catch (err) { @@ -26925,32 +28690,33 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get Code Coverage Summary for Build. - * - * @param {string} project - Project ID or project name - * @param {number} buildId - ID of the build for which code coverage data needs to be fetched. - * @param {number} deltaBuildId - Delta Build id (optional) + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @param {string} name */ - getCodeCoverageSummary(project, buildId, deltaBuildId) { + getAttachment(scopeIdentifier, hubName, planId, timelineId, recordId, type, name) { return __awaiter(this, void 0, void 0, function* () { - if (buildId == null) { - throw new TypeError('buildId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - buildId: buildId, - deltaBuildId: deltaBuildId, + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId, + recordId: recordId, + type: type, + name: name }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "77560e8a-4e8c-4d59-894e-a5f264c24444", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "7898f959-9cdf-4096-b29e-7f293031629e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.CodeCoverageSummary, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAttachment, false); resolve(ret); } catch (err) { @@ -26960,32 +28726,32 @@ class TestApi extends basem.ClientApiBase { }); } /** - * http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary - * - * @param {TestInterfaces.CodeCoverageData} coverageData - * @param {string} project - Project ID or project name - * @param {number} buildId + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type + * @param {string} name */ - updateCodeCoverageSummary(coverageData, project, buildId) { + getAttachmentContent(scopeIdentifier, hubName, planId, timelineId, recordId, type, name) { return __awaiter(this, void 0, void 0, function* () { - if (buildId == null) { - throw new TypeError('buildId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - buildId: buildId, + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId, + recordId: recordId, + type: type, + name: name }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "77560e8a-4e8c-4d59-894e-a5f264c24444", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "7898f959-9cdf-4096-b29e-7f293031629e", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, coverageData, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -26994,32 +28760,31 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get code coverage data for a test run - * - * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run for which code coverage data needs to be fetched. - * @param {number} flags - Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} type */ - getTestRunCodeCoverage(project, runId, flags) { + getAttachments(scopeIdentifier, hubName, planId, timelineId, recordId, type) { return __awaiter(this, void 0, void 0, function* () { - if (flags == null) { - throw new TypeError('flags can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId - }; - let queryValues = { - flags: flags, + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId, + recordId: recordId, + type: type }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "9629116f-3b89-4ed8-b358-d4694efda160", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "7898f959-9cdf-4096-b29e-7f293031629e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAttachment, true); resolve(ret); } catch (err) { @@ -27029,22 +28794,32 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {TestInterfaces.CustomTestFieldDefinition[]} newFields - * @param {string} project - Project ID or project name + * Append content to timeline record feed. + * + * @param {TaskAgentInterfaces.TimelineRecordFeedLinesWrapper} lines - Content to be appended to the timeline record feed. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId - ID of the plan. + * @param {string} timelineId - ID of the task's timeline. + * @param {string} recordId - ID of the timeline record. */ - addCustomFields(newFields, project) { + appendTimelineRecordFeed(lines, scopeIdentifier, hubName, planId, timelineId, recordId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId, + recordId: recordId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "8ce1923b-f4c7-4e22-b93b-f6284e525ec2", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "858983e4-19bd-4c5e-864c-507b59b58b12", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, newFields, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.CustomTestFieldDefinition, true); + res = yield this.rest.create(url, lines, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -27054,28 +28829,42 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {TestInterfaces.CustomTestFieldScope} scopeFilter + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} timelineId + * @param {string} recordId + * @param {string} stepId + * @param {number} endLine + * @param {number} takeCount + * @param {string} continuationToken */ - queryCustomFields(project, scopeFilter) { + getLines(scopeIdentifier, hubName, planId, timelineId, recordId, stepId, endLine, takeCount, continuationToken) { return __awaiter(this, void 0, void 0, function* () { - if (scopeFilter == null) { - throw new TypeError('scopeFilter can not be null or undefined'); + if (stepId == null) { + throw new TypeError('stepId can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId, + recordId: recordId }; let queryValues = { - scopeFilter: scopeFilter, + stepId: stepId, + endLine: endLine, + takeCount: takeCount, + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "8ce1923b-f4c7-4e22-b93b-f6284e525ec2", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "858983e4-19bd-4c5e-864c-507b59b58b12", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.CustomTestFieldDefinition, true); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -27085,22 +28874,25 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {TestInterfaces.ResultsFilter} filter - * @param {string} project - Project ID or project name + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} orchestrationId */ - queryTestResultHistory(filter, project) { + getJobInstance(scopeIdentifier, hubName, orchestrationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + scopeIdentifier: scopeIdentifier, + hubName: hubName, + orchestrationId: orchestrationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "234616f5-429c-4e7b-9192-affd76731dfd", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "0a1efd25-abda-43bd-9629-6c7bdd2e0d60", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, filter, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultHistory, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskAgentJob, false); resolve(ret); } catch (err) { @@ -27110,33 +28902,33 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get iteration for a result + * Append a log to a task's log. The log should be sent in the body of the request as a TaskLog object stream. * - * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the result. - * @param {number} testCaseResultId - ID of the test result that contains the iterations. - * @param {number} iterationId - Id of the test results Iteration. - * @param {boolean} includeActionResults - Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration. + * @param {NodeJS.ReadableStream} contentStream - Content to upload + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId - The ID of the plan. + * @param {number} logId - The ID of the log. */ - getTestIteration(project, runId, testCaseResultId, iterationId, includeActionResults) { + appendLogContent(customHeaders, contentStream, scopeIdentifier, hubName, planId, logId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId, - testCaseResultId: testCaseResultId, - iterationId: iterationId - }; - let queryValues = { - includeActionResults: includeActionResults, + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + logId: logId }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "73eb9074-3446-4c44-8296-2f811950ff8d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "46f5667d-263a-4684-91b1-dff7fdcf64e2", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestIterationDetailsModel, false); + res = yield this.rest.uploadStream("POST", url, contentStream, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskLog, false); resolve(ret); } catch (err) { @@ -27146,31 +28938,39 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get iterations for a result - * - * @param {string} project - Project ID or project name - * @param {number} runId - ID of the test run that contains the result. - * @param {number} testCaseResultId - ID of the test result that contains the iterations. - * @param {boolean} includeActionResults - Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {number} logId + * @param {string} serializedBlobId + * @param {number} lineCount */ - getTestIterations(project, runId, testCaseResultId, includeActionResults) { + associateLog(scopeIdentifier, hubName, planId, logId, serializedBlobId, lineCount) { return __awaiter(this, void 0, void 0, function* () { + if (serializedBlobId == null) { + throw new TypeError('serializedBlobId can not be null or undefined'); + } + if (lineCount == null) { + throw new TypeError('lineCount can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId, - testCaseResultId: testCaseResultId - }; + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + logId: logId + }; let queryValues = { - includeActionResults: includeActionResults, + serializedBlobId: serializedBlobId, + lineCount: lineCount, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "73eb9074-3446-4c44-8296-2f811950ff8d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "46f5667d-263a-4684-91b1-dff7fdcf64e2", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestIterationDetailsModel, true); + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskLog, false); resolve(ret); } catch (err) { @@ -27180,22 +28980,28 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {TestInterfaces.LinkedWorkItemsQuery} workItemQuery - * @param {string} project - Project ID or project name + * Create a log and connect it to a pipeline run's execution plan. + * + * @param {TaskAgentInterfaces.TaskLog} log - An object that contains information about log's path. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId - The ID of the plan. */ - getLinkedWorkItemsByQuery(workItemQuery, project) { + createLog(log, scopeIdentifier, hubName, planId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "a4dcb25b-9878-49ea-abfd-e440bd9b1dcd", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "46f5667d-263a-4684-91b1-dff7fdcf64e2", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, workItemQuery, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, log, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskLog, false); resolve(ret); } catch (err) { @@ -27205,25 +29011,33 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get test run message logs - * - * @param {string} project - Project ID or project name - * @param {number} runId - ID of the run to get. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {number} logId + * @param {number} startLine + * @param {number} endLine */ - getTestRunLogs(project, runId) { + getLog(scopeIdentifier, hubName, planId, logId, startLine, endLine) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + logId: logId + }; + let queryValues = { + startLine: startLine, + endLine: endLine, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "a1e55200-637e-42e9-a7c0-7e5bfdedb1b3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "46f5667d-263a-4684-91b1-dff7fdcf64e2", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestMessageLogDetails, true); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -27233,33 +29047,25 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get a test point. - * - * @param {string} project - Project ID or project name - * @param {number} planId - ID of the test plan. - * @param {number} suiteId - ID of the suite that contains the point. - * @param {number} pointIds - ID of the test point to get. - * @param {string} witFields - Comma-separated list of work item field names. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId */ - getPoint(project, planId, suiteId, pointIds, witFields) { + getLogs(scopeIdentifier, hubName, planId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - planId: planId, - suiteId: suiteId, - pointIds: pointIds - }; - let queryValues = { - witFields: witFields, + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Test", "3bcfd5c8-be62-488e-b1da-b8289ce9299c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "46f5667d-263a-4684-91b1-dff7fdcf64e2", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPoint, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskLog, true); resolve(ret); } catch (err) { @@ -27269,43 +29075,23 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get a list of test points. - * - * @param {string} project - Project ID or project name - * @param {number} planId - ID of the test plan. - * @param {number} suiteId - ID of the suite that contains the points. - * @param {string} witFields - Comma-separated list of work item field names. - * @param {string} configurationId - Get test points for specific configuration. - * @param {string} testCaseId - Get test points for a specific test case, valid when configurationId is not set. - * @param {string} testPointIds - Get test points for comma-separated list of test point IDs, valid only when configurationId and testCaseId are not set. - * @param {boolean} includePointDetails - Include all properties for the test point. - * @param {number} skip - Number of test points to skip.. - * @param {number} top - Number of test points to return. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" */ - getPoints(project, planId, suiteId, witFields, configurationId, testCaseId, testPointIds, includePointDetails, skip, top) { + getPlanGroupsQueueMetrics(scopeIdentifier, hubName) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - planId: planId, - suiteId: suiteId - }; - let queryValues = { - witFields: witFields, - configurationId: configurationId, - testCaseId: testCaseId, - testPointIds: testPointIds, - includePointDetails: includePointDetails, - '$skip': skip, - '$top': top, + scopeIdentifier: scopeIdentifier, + hubName: hubName }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Test", "3bcfd5c8-be62-488e-b1da-b8289ce9299c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "038fd4d5-cda7-44ca-92c0-935843fee1a7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPoint, true); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskOrchestrationPlanGroupsQueueMetrics, true); resolve(ret); } catch (err) { @@ -27315,30 +29101,32 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Update test points. - * - * @param {TestInterfaces.PointUpdateModel} pointUpdateModel - Data to update. - * @param {string} project - Project ID or project name - * @param {number} planId - ID of the test plan. - * @param {number} suiteId - ID of the suite that contains the points. - * @param {string} pointIds - ID of the test point to get. Use a comma-separated list of IDs to update multiple test points. + * @param {{ [key: string] : string; }} claims + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} jobId + * @param {string} serviceConnectionId */ - updateTestPoints(pointUpdateModel, project, planId, suiteId, pointIds) { + createOidcToken(claims, scopeIdentifier, hubName, planId, jobId, serviceConnectionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, + scopeIdentifier: scopeIdentifier, + hubName: hubName, planId: planId, - suiteId: suiteId, - pointIds: pointIds + jobId: jobId + }; + let queryValues = { + serviceConnectionId: serviceConnectionId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Test", "3bcfd5c8-be62-488e-b1da-b8289ce9299c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "69a319f4-28c1-4bfd-93e6-ea0ff5c6f1a2", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, pointUpdateModel, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPoint, true); + res = yield this.rest.create(url, claims, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -27348,30 +29136,29 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get test points using query. - * - * @param {TestInterfaces.TestPointsQuery} query - TestPointsQuery to get test points. - * @param {string} project - Project ID or project name - * @param {number} skip - Number of test points to skip.. - * @param {number} top - Number of test points to return. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {TaskAgentInterfaces.PlanGroupStatus} statusFilter + * @param {number} count */ - getPointsByQuery(query, project, skip, top) { + getQueuedPlanGroups(scopeIdentifier, hubName, statusFilter, count) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + scopeIdentifier: scopeIdentifier, + hubName: hubName }; let queryValues = { - '$skip': skip, - '$top': top, + statusFilter: statusFilter, + count: count, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Test", "b4264fd0-a5d1-43e2-82a5-b9c46b7da9ce", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "0dd73091-3e36-4f43-b443-1b76dd426d84", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, query, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPointsQuery, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskOrchestrationQueuedPlanGroup, true); resolve(ret); } catch (err) { @@ -27381,40 +29168,25 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} publishContext - * @param {string} groupBy - * @param {string} filter - * @param {string} orderby - * @param {boolean} shouldIncludeResults - * @param {boolean} queryRunSummaryForInProgress + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planGroup */ - getTestResultDetailsForBuild(project, buildId, publishContext, groupBy, filter, orderby, shouldIncludeResults, queryRunSummaryForInProgress) { + getQueuedPlanGroup(scopeIdentifier, hubName, planGroup) { return __awaiter(this, void 0, void 0, function* () { - if (buildId == null) { - throw new TypeError('buildId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - buildId: buildId, - publishContext: publishContext, - groupBy: groupBy, - '$filter': filter, - '$orderby': orderby, - shouldIncludeResults: shouldIncludeResults, - queryRunSummaryForInProgress: queryRunSummaryForInProgress, + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planGroup: planGroup }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Test", "efb387b0-10d5-42e7-be40-95e06ee9430f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "distributedtask", "65fd0708-bc1e-447b-a731-0587c5464e5b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultsDetails, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskOrchestrationQueuedPlanGroup, false); resolve(ret); } catch (err) { @@ -27424,45 +29196,25 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} releaseEnvId - * @param {string} publishContext - * @param {string} groupBy - * @param {string} filter - * @param {string} orderby - * @param {boolean} shouldIncludeResults - * @param {boolean} queryRunSummaryForInProgress + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId */ - getTestResultDetailsForRelease(project, releaseId, releaseEnvId, publishContext, groupBy, filter, orderby, shouldIncludeResults, queryRunSummaryForInProgress) { + getPlan(scopeIdentifier, hubName, planId) { return __awaiter(this, void 0, void 0, function* () { - if (releaseId == null) { - throw new TypeError('releaseId can not be null or undefined'); - } - if (releaseEnvId == null) { - throw new TypeError('releaseEnvId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - releaseId: releaseId, - releaseEnvId: releaseEnvId, - publishContext: publishContext, - groupBy: groupBy, - '$filter': filter, - '$orderby': orderby, - shouldIncludeResults: shouldIncludeResults, - queryRunSummaryForInProgress: queryRunSummaryForInProgress, + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Test", "b834ec7e-35bb-450f-a3c8-802e70ca40dd", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "5cecd946-d704-471e-a45f-3b4064fcfaba", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultsDetails, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TaskOrchestrationPlan, false); resolve(ret); } catch (err) { @@ -27472,24 +29224,31 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {TestInterfaces.TestResultDocument} document - * @param {string} project - Project ID or project name - * @param {number} runId + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} timelineId + * @param {number} changeId */ - publishTestResultDocument(document, project, runId) { + getRecords(scopeIdentifier, hubName, planId, timelineId, changeId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId + }; + let queryValues = { + changeId: changeId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "370ca04b-8eec-4ca8-8ba3-d24dca228791", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "8893bc5b-35b2-4be7-83cb-99e683551db4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, document, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TimelineRecord, true); resolve(ret); } catch (err) { @@ -27499,37 +29258,30 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} publishContext - * @param {string[]} fields - * @param {string} continuationToken + * Update timeline records if they already exist, otherwise create new ones for the same timeline. + * + * @param {VSSInterfaces.VssJsonCollectionWrapperV} records - The array of timeline records to be updated. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId - The ID of the plan. + * @param {string} timelineId - The ID of the timeline. */ - getResultGroupsByBuild(project, buildId, publishContext, fields, continuationToken) { + updateRecords(records, scopeIdentifier, hubName, planId, timelineId) { return __awaiter(this, void 0, void 0, function* () { - if (buildId == null) { - throw new TypeError('buildId can not be null or undefined'); - } - if (publishContext == null) { - throw new TypeError('publishContext can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - buildId: buildId, - publishContext: publishContext, - fields: fields && fields.join(","), - continuationToken: continuationToken, + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Test", "d279d052-c55a-4204-b913-42f733b52958", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "8893bc5b-35b2-4be7-83cb-99e683551db4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.update(url, records, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.TimelineRecord, true); resolve(ret); } catch (err) { @@ -27539,39 +29291,26 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {string} publishContext - * @param {number} releaseEnvId - * @param {string[]} fields - * @param {string} continuationToken + * @param {TaskAgentInterfaces.Timeline} timeline + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId */ - getResultGroupsByRelease(project, releaseId, publishContext, releaseEnvId, fields, continuationToken) { + createTimeline(timeline, scopeIdentifier, hubName, planId) { return __awaiter(this, void 0, void 0, function* () { - if (releaseId == null) { - throw new TypeError('releaseId can not be null or undefined'); - } - if (publishContext == null) { - throw new TypeError('publishContext can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - releaseId: releaseId, - publishContext: publishContext, - releaseEnvId: releaseEnvId, - fields: fields && fields.join(","), - continuationToken: continuationToken, + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Test", "ef5ce5d4-a4e5-47ee-804c-354518f8d03f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "83597576-cc2c-453c-bea6-2882ae6a1653", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, timeline, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.Timeline, false); resolve(ret); } catch (err) { @@ -27581,24 +29320,27 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get list of test Result meta data details for corresponding testcasereferenceId - * - * @param {string[]} testReferenceIds - TestCaseReference Ids of the test Result to be queried, comma separated list of valid ids (limit no. of ids 200). - * @param {string} project - Project ID or project name + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} timelineId */ - queryTestResultsMetaData(testReferenceIds, project) { + deleteTimeline(scopeIdentifier, hubName, planId, timelineId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Test", "afa7830e-67a7-4336-8090-2b448ca80295", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "83597576-cc2c-453c-bea6-2882ae6a1653", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, testReferenceIds, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -27608,23 +29350,33 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get test result retention settings - * - * @param {string} project - Project ID or project name + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId + * @param {string} timelineId + * @param {number} changeId + * @param {boolean} includeRecords */ - getResultRetentionSettings(project) { + getTimeline(scopeIdentifier, hubName, planId, timelineId, changeId, includeRecords) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId, + timelineId: timelineId + }; + let queryValues = { + changeId: changeId, + includeRecords: includeRecords, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "a3206d9e-fa8d-42d3-88cb-f75c51e69cde", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "83597576-cc2c-453c-bea6-2882ae6a1653", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.ResultRetentionSettings, false); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.Timeline, false); resolve(ret); } catch (err) { @@ -27634,24 +29386,25 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Update test result retention settings - * - * @param {TestInterfaces.ResultRetentionSettings} retentionSettings - Test result retention settings details to be updated - * @param {string} project - Project ID or project name + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks" + * @param {string} planId */ - updateResultRetentionSettings(retentionSettings, project) { + getTimelines(scopeIdentifier, hubName, planId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + scopeIdentifier: scopeIdentifier, + hubName: hubName, + planId: planId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "a3206d9e-fa8d-42d3-88cb-f75c51e69cde", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "distributedtask", "83597576-cc2c-453c-bea6-2882ae6a1653", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, retentionSettings, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.ResultRetentionSettings, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TaskAgentInterfaces.TypeInfo.Timeline, true); resolve(ret); } catch (err) { @@ -27660,27 +29413,75 @@ class TestApi extends basem.ClientApiBase { })); }); } +} +exports.TaskApi = TaskApi; + + +/***/ }), + +/***/ 5742: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TestApi = void 0; +const basem = __nccwpck_require__(273); +const TestInterfaces = __nccwpck_require__(3047); +class TestApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Test-api', options); + } /** - * Add test results to a test run. + * Attach a file to test step result * - * @param {TestInterfaces.TestCaseResult[]} results - List of test results to add. + * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment details TestAttachmentRequestModel * @param {string} project - Project ID or project name - * @param {number} runId - Test run ID into which test results to add. + * @param {number} runId - ID of the test run that contains the result. + * @param {number} testCaseResultId - ID of the test result that contains the iteration + * @param {number} iterationId - ID of the test result iteration. + * @param {string} actionPath - Hex value of test result action path. */ - addTestResultsToTestRun(results, project, runId) { + createTestIterationResultAttachment(attachmentRequestModel, project, runId, testCaseResultId, iterationId, actionPath) { return __awaiter(this, void 0, void 0, function* () { + if (iterationId == null) { + throw new TypeError('iterationId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId + runId: runId, + testCaseResultId: testCaseResultId + }; + let queryValues = { + iterationId: iterationId, + actionPath: actionPath, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.6", "Test", "4637d869-3a76-4468-8057-0bb02aa385cf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, results, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestCaseResult, true); + res = yield this.rest.create(url, attachmentRequestModel, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -27690,14 +29491,14 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get a test result for a test run. + * Attach a file to a test result. * + * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment details TestAttachmentRequestModel * @param {string} project - Project ID or project name - * @param {number} runId - Test run ID of a test result to fetch. - * @param {number} testCaseResultId - Test result ID. - * @param {TestInterfaces.ResultDetails} detailsToInclude - Details to include with test results. Default is None. Other values are Iterations, WorkItems and SubResults. + * @param {number} runId - ID of the test run that contains the result. + * @param {number} testCaseResultId - ID of the test result against which attachment has to be uploaded. */ - getTestResultById(project, runId, testCaseResultId, detailsToInclude) { + createTestResultAttachment(attachmentRequestModel, project, runId, testCaseResultId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { @@ -27705,16 +29506,13 @@ class TestApi extends basem.ClientApiBase { runId: runId, testCaseResultId: testCaseResultId }; - let queryValues = { - detailsToInclude: detailsToInclude, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.6", "Test", "4637d869-3a76-4468-8057-0bb02aa385cf", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestCaseResult, false); + res = yield this.rest.create(url, attachmentRequestModel, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -27724,35 +29522,35 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get test results for a test run. + * Attach a file to a test result * + * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment Request Model. * @param {string} project - Project ID or project name - * @param {number} runId - Test run ID of test results to fetch. - * @param {TestInterfaces.ResultDetails} detailsToInclude - Details to include with test results. Default is None. Other values are Iterations and WorkItems. - * @param {number} skip - Number of test results to skip from beginning. - * @param {number} top - Number of test results to return. Maximum is 1000 when detailsToInclude is None and 200 otherwise. - * @param {TestInterfaces.TestOutcome[]} outcomes - Comma separated list of test outcomes to filter test results. + * @param {number} runId - ID of the test run that contains the result. + * @param {number} testCaseResultId - ID of the test results that contains sub result. + * @param {number} testSubResultId - ID of the test sub results against which attachment has to be uploaded. */ - getTestResults(project, runId, detailsToInclude, skip, top, outcomes) { + createTestSubResultAttachment(attachmentRequestModel, project, runId, testCaseResultId, testSubResultId) { return __awaiter(this, void 0, void 0, function* () { + if (testSubResultId == null) { + throw new TypeError('testSubResultId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId + runId: runId, + testCaseResultId: testCaseResultId }; let queryValues = { - detailsToInclude: detailsToInclude, - '$skip': skip, - '$top': top, - outcomes: outcomes && outcomes.join(","), + testSubResultId: testSubResultId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.6", "Test", "4637d869-3a76-4468-8057-0bb02aa385cf", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestCaseResult, true); + res = yield this.rest.create(url, attachmentRequestModel, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -27762,27 +29560,28 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Update test results in a test run. + * Download a test result attachment by its ID. * - * @param {TestInterfaces.TestCaseResult[]} results - List of test results to update. * @param {string} project - Project ID or project name - * @param {number} runId - Test run ID whose test results to update. + * @param {number} runId - ID of the test run that contains the testCaseResultId. + * @param {number} testCaseResultId - ID of the test result whose attachment has to be downloaded. + * @param {number} attachmentId - ID of the test result attachment to be downloaded. */ - updateTestResults(results, project, runId) { + getTestResultAttachmentContent(project, runId, testCaseResultId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.6", "Test", "4637d869-3a76-4468-8057-0bb02aa385cf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.update(url, results, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestCaseResult, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -27791,24 +29590,27 @@ class TestApi extends basem.ClientApiBase { }); } /** - * This API will return results by Ids with fields specified/trend for particular automated test method. We are still improving this API and have not finalized proper signature and contract. + * Get list of test result attachments reference. * - * @param {TestInterfaces.TestResultsQuery} query * @param {string} project - Project ID or project name + * @param {number} runId - ID of the test run that contains the result. + * @param {number} testCaseResultId - ID of the test result. */ - getTestResultsByQuery(query, project) { + getTestResultAttachments(project, runId, testCaseResultId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId, + testCaseResultId: testCaseResultId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.6", "Test", "6711da49-8e6f-4d35-9f73-cef7a3c81a5b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, query, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultsQuery, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestAttachment, true); resolve(ret); } catch (err) { @@ -27818,37 +29620,28 @@ class TestApi extends basem.ClientApiBase { }); } /** + * Download a test result attachment by its ID. + * * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} publishContext - * @param {TestInterfaces.TestOutcome[]} outcomes - * @param {number} top - * @param {string} continuationToken + * @param {number} runId - ID of the test run that contains the testCaseResultId. + * @param {number} testCaseResultId - ID of the test result whose attachment has to be downloaded. + * @param {number} attachmentId - ID of the test result attachment to be downloaded. */ - getTestResultsByBuild(project, buildId, publishContext, outcomes, top, continuationToken) { + getTestResultAttachmentZip(project, runId, testCaseResultId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { - if (buildId == null) { - throw new TypeError('buildId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - buildId: buildId, - publishContext: publishContext, - outcomes: outcomes && outcomes.join(","), - '$top': top, - continuationToken: continuationToken, + project: project, + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "3c191b88-615b-4be2-b7d9-5ff9141e91d4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -27857,39 +29650,35 @@ class TestApi extends basem.ClientApiBase { }); } /** + * Download a test sub result attachment + * * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} releaseEnvid - * @param {string} publishContext - * @param {TestInterfaces.TestOutcome[]} outcomes - * @param {number} top - * @param {string} continuationToken + * @param {number} runId - ID of the test run that contains the result. + * @param {number} testCaseResultId - ID of the test results that contains sub result. + * @param {number} attachmentId - ID of the test result attachment to be downloaded + * @param {number} testSubResultId - ID of the test sub result whose attachment has to be downloaded */ - getTestResultsByRelease(project, releaseId, releaseEnvid, publishContext, outcomes, top, continuationToken) { + getTestSubResultAttachmentContent(project, runId, testCaseResultId, attachmentId, testSubResultId) { return __awaiter(this, void 0, void 0, function* () { - if (releaseId == null) { - throw new TypeError('releaseId can not be null or undefined'); + if (testSubResultId == null) { + throw new TypeError('testSubResultId can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId }; let queryValues = { - releaseId: releaseId, - releaseEnvid: releaseEnvid, - publishContext: publishContext, - outcomes: outcomes && outcomes.join(","), - '$top': top, - continuationToken: continuationToken, + testSubResultId: testSubResultId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "ce01820b-83f3-4c15-a583-697a43292c4e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -27898,34 +29687,34 @@ class TestApi extends basem.ClientApiBase { }); } /** + * Get list of test sub result attachments + * * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} publishContext - * @param {boolean} includeFailureDetails - * @param {TestInterfaces.BuildReference} buildToCompare + * @param {number} runId - ID of the test run that contains the result. + * @param {number} testCaseResultId - ID of the test results that contains sub result. + * @param {number} testSubResultId - ID of the test sub result whose attachment has to be downloaded */ - queryTestResultsReportForBuild(project, buildId, publishContext, includeFailureDetails, buildToCompare) { + getTestSubResultAttachments(project, runId, testCaseResultId, testSubResultId) { return __awaiter(this, void 0, void 0, function* () { - if (buildId == null) { - throw new TypeError('buildId can not be null or undefined'); + if (testSubResultId == null) { + throw new TypeError('testSubResultId can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId, + testCaseResultId: testCaseResultId }; let queryValues = { - buildId: buildId, - publishContext: publishContext, - includeFailureDetails: includeFailureDetails, - buildToCompare: buildToCompare, + testSubResultId: testSubResultId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "000ef77b-fea2-498d-a10d-ad1a037f559f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultSummary, false); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestAttachment, true); resolve(ret); } catch (err) { @@ -27935,40 +29724,35 @@ class TestApi extends basem.ClientApiBase { }); } /** + * Download a test sub result attachment + * * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} releaseEnvId - * @param {string} publishContext - * @param {boolean} includeFailureDetails - * @param {TestInterfaces.ReleaseReference} releaseToCompare + * @param {number} runId - ID of the test run that contains the result. + * @param {number} testCaseResultId - ID of the test results that contains sub result. + * @param {number} attachmentId - ID of the test result attachment to be downloaded + * @param {number} testSubResultId - ID of the test sub result whose attachment has to be downloaded */ - queryTestResultsReportForRelease(project, releaseId, releaseEnvId, publishContext, includeFailureDetails, releaseToCompare) { + getTestSubResultAttachmentZip(project, runId, testCaseResultId, attachmentId, testSubResultId) { return __awaiter(this, void 0, void 0, function* () { - if (releaseId == null) { - throw new TypeError('releaseId can not be null or undefined'); - } - if (releaseEnvId == null) { - throw new TypeError('releaseEnvId can not be null or undefined'); + if (testSubResultId == null) { + throw new TypeError('testSubResultId can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId }; let queryValues = { - releaseId: releaseId, - releaseEnvId: releaseEnvId, - publishContext: publishContext, - includeFailureDetails: includeFailureDetails, - releaseToCompare: releaseToCompare, + testSubResultId: testSubResultId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "85765790-ac68-494e-b268-af36c3929744", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultSummary, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -27977,22 +29761,26 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {TestInterfaces.ReleaseReference[]} releases + * Attach a file to a test run. + * + * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - Attachment details TestAttachmentRequestModel * @param {string} project - Project ID or project name + * @param {number} runId - ID of the test run against which attachment has to be uploaded. */ - queryTestResultsSummaryForReleases(releases, project) { + createTestRunAttachment(attachmentRequestModel, project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "85765790-ac68-494e-b268-af36c3929744", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, releases, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultSummary, true); + res = yield this.rest.create(url, attachmentRequestModel, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -28002,27 +29790,26 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {TestInterfaces.TestResultsContext} resultsContext + * Download a test run attachment by its ID. + * * @param {string} project - Project ID or project name - * @param {number[]} workItemIds + * @param {number} runId - ID of the test run whose attachment has to be downloaded. + * @param {number} attachmentId - ID of the test run attachment to be downloaded. */ - queryTestSummaryByRequirement(resultsContext, project, workItemIds) { + getTestRunAttachmentContent(project, runId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - workItemIds: workItemIds && workItemIds.join(","), + project: project, + runId: runId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "cd08294e-308d-4460-a46e-4cfdefba0b4b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, resultsContext, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestSummaryForWorkItem, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -28031,22 +29818,25 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {TestInterfaces.TestResultTrendFilter} filter + * Get list of test run attachments reference. + * * @param {string} project - Project ID or project name + * @param {number} runId - ID of the test run. */ - queryResultTrendForBuild(filter, project) { + getTestRunAttachments(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "fbc82a85-0786-4442-88bb-eb0fda6b01b0", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, filter, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.AggregatedDataForResultTrend, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestAttachment, true); resolve(ret); } catch (err) { @@ -28056,23 +29846,26 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {TestInterfaces.TestResultTrendFilter} filter + * Download a test run attachment by its ID. + * * @param {string} project - Project ID or project name + * @param {number} runId - ID of the test run whose attachment has to be downloaded. + * @param {number} attachmentId - ID of the test run attachment to be downloaded. */ - queryResultTrendForRelease(filter, project) { + getTestRunAttachmentZip(project, runId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "dd178e93-d8dd-4887-9635-d6b9560b7b6e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "4f004af4-a507-489c-9b13-cb62060beb11", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, filter, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.AggregatedDataForResultTrend, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -28081,25 +29874,25 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get test run statistics , used when we want to get summary of a run by outcome. - * * @param {string} project - Project ID or project name - * @param {number} runId - ID of the run to get. + * @param {number} runId + * @param {number} testCaseResultId */ - getTestRunStatistics(project, runId) { + getBugsLinkedToTestResult(project, runId, testCaseResultId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - runId: runId + runId: runId, + testCaseResultId: testCaseResultId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "0a42c424-d764-4a16-a2d5-5c85f87d0ae8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "6de20ca2-67de-4faf-97fa-38c5d585eb00", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRunStatistic, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -28109,24 +29902,35 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Create new test run. + * Get code coverage data for a build. * - * @param {TestInterfaces.RunCreateModel} testRun - Run details RunCreateModel * @param {string} project - Project ID or project name + * @param {number} buildId - ID of the build for which code coverage data needs to be fetched. + * @param {number} flags - Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData. */ - createTestRun(testRun, project) { + getBuildCodeCoverage(project, buildId, flags) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } + if (flags == null) { + throw new TypeError('flags can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + buildId: buildId, + flags: flags, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "77560e8a-4e8c-4d59-894e-a5f264c24444", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, testRun, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRun, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.BuildCoverage, true); resolve(ret); } catch (err) { @@ -28136,25 +29940,32 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Delete a test run by its ID. + * Get Code Coverage Summary for Build. * * @param {string} project - Project ID or project name - * @param {number} runId - ID of the run to delete. + * @param {number} buildId - ID of the build for which code coverage data needs to be fetched. + * @param {number} deltaBuildId - Delta Build id (optional) */ - deleteTestRun(project, runId) { + getCodeCoverageSummary(project, buildId, deltaBuildId) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId + project: project + }; + let queryValues = { + buildId: buildId, + deltaBuildId: deltaBuildId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "77560e8a-4e8c-4d59-894e-a5f264c24444", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.CodeCoverageSummary, false); resolve(ret); } catch (err) { @@ -28164,29 +29975,31 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get a test run by its ID. + * http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary * + * @param {TestInterfaces.CodeCoverageData} coverageData * @param {string} project - Project ID or project name - * @param {number} runId - ID of the run to get. - * @param {boolean} includeDetails - Default value is true. It includes details like run statistics, release, build, test environment, post process state, and more. + * @param {number} buildId */ - getTestRunById(project, runId, includeDetails) { + updateCodeCoverageSummary(coverageData, project, buildId) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId + project: project }; let queryValues = { - includeDetails: includeDetails, + buildId: buildId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "77560e8a-4e8c-4d59-894e-a5f264c24444", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRun, false); + res = yield this.rest.create(url, coverageData, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -28196,41 +30009,32 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get a list of test runs. + * Get code coverage data for a test run * * @param {string} project - Project ID or project name - * @param {string} buildUri - URI of the build that the runs used. - * @param {string} owner - Team foundation ID of the owner of the runs. - * @param {string} tmiRunId - * @param {number} planId - ID of the test plan that the runs are a part of. - * @param {boolean} includeRunDetails - If true, include all the properties of the runs. - * @param {boolean} automated - If true, only returns automated runs. - * @param {number} skip - Number of test runs to skip. - * @param {number} top - Number of test runs to return. + * @param {number} runId - ID of the test run for which code coverage data needs to be fetched. + * @param {number} flags - Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData. */ - getTestRuns(project, buildUri, owner, tmiRunId, planId, includeRunDetails, automated, skip, top) { + getTestRunCodeCoverage(project, runId, flags) { return __awaiter(this, void 0, void 0, function* () { + if (flags == null) { + throw new TypeError('flags can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId }; let queryValues = { - buildUri: buildUri, - owner: owner, - tmiRunId: tmiRunId, - planId: planId, - includeRunDetails: includeRunDetails, - automated: automated, - '$skip': skip, - '$top': top, + flags: flags, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "9629116f-3b89-4ed8-b358-d4694efda160", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRun, true); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -28240,63 +30044,22 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate. - * + * @param {TestInterfaces.CustomTestFieldDefinition[]} newFields * @param {string} project - Project ID or project name - * @param {Date} minLastUpdatedDate - Minimum Last Modified Date of run to be queried (Mandatory). - * @param {Date} maxLastUpdatedDate - Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days). - * @param {TestInterfaces.TestRunState} state - Current state of the Runs to be queried. - * @param {number[]} planIds - Plan Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). - * @param {boolean} isAutomated - Automation type of the Runs to be queried. - * @param {TestInterfaces.TestRunPublishContext} publishContext - PublishContext of the Runs to be queried. - * @param {number[]} buildIds - Build Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). - * @param {number[]} buildDefIds - Build Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). - * @param {string} branchName - Source Branch name of the Runs to be queried. - * @param {number[]} releaseIds - Release Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). - * @param {number[]} releaseDefIds - Release Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). - * @param {number[]} releaseEnvIds - Release Environment Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). - * @param {number[]} releaseEnvDefIds - Release Environment Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). - * @param {string} runTitle - Run Title of the Runs to be queried. - * @param {number} top - Number of runs to be queried. Limit is 100 - * @param {string} continuationToken - continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user. */ - queryTestRuns(project, minLastUpdatedDate, maxLastUpdatedDate, state, planIds, isAutomated, publishContext, buildIds, buildDefIds, branchName, releaseIds, releaseDefIds, releaseEnvIds, releaseEnvDefIds, runTitle, top, continuationToken) { + addCustomFields(newFields, project) { return __awaiter(this, void 0, void 0, function* () { - if (minLastUpdatedDate == null) { - throw new TypeError('minLastUpdatedDate can not be null or undefined'); - } - if (maxLastUpdatedDate == null) { - throw new TypeError('maxLastUpdatedDate can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; - let queryValues = { - minLastUpdatedDate: minLastUpdatedDate, - maxLastUpdatedDate: maxLastUpdatedDate, - state: state, - planIds: planIds && planIds.join(","), - isAutomated: isAutomated, - publishContext: publishContext, - buildIds: buildIds && buildIds.join(","), - buildDefIds: buildDefIds && buildDefIds.join(","), - branchName: branchName, - releaseIds: releaseIds && releaseIds.join(","), - releaseDefIds: releaseDefIds && releaseDefIds.join(","), - releaseEnvIds: releaseEnvIds && releaseEnvIds.join(","), - releaseEnvDefIds: releaseEnvDefIds && releaseEnvDefIds.join(","), - runTitle: runTitle, - '$top': top, - continuationToken: continuationToken, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "8ce1923b-f4c7-4e22-b93b-f6284e525ec2", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRun, true); + res = yield this.rest.create(url, newFields, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.CustomTestFieldDefinition, true); resolve(ret); } catch (err) { @@ -28306,26 +30069,28 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Update test run by its ID. - * - * @param {TestInterfaces.RunUpdateModel} runUpdateModel - Run details RunUpdateModel * @param {string} project - Project ID or project name - * @param {number} runId - ID of the run to update. + * @param {TestInterfaces.CustomTestFieldScope} scopeFilter */ - updateTestRun(runUpdateModel, project, runId) { + queryCustomFields(project, scopeFilter) { return __awaiter(this, void 0, void 0, function* () { + if (scopeFilter == null) { + throw new TypeError('scopeFilter can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - runId: runId + project: project + }; + let queryValues = { + scopeFilter: scopeFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "8ce1923b-f4c7-4e22-b93b-f6284e525ec2", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, runUpdateModel, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRun, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.CustomTestFieldDefinition, true); resolve(ret); } catch (err) { @@ -28335,31 +30100,22 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Create a test session - * - * @param {TestInterfaces.TestSession} testSession - Test session details for creation - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {TestInterfaces.ResultsFilter} filter + * @param {string} project - Project ID or project name */ - createTestSession(testSession, teamContext) { + queryTestResultHistory(filter, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "234616f5-429c-4e7b-9192-affd76731dfd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, testSession, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestSession, false); + res = yield this.rest.create(url, filter, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultHistory, false); resolve(ret); } catch (err) { @@ -28369,42 +30125,33 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get a list of test sessions + * Get iteration for a result * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {number} period - Period in days from now, for which test sessions are fetched. - * @param {boolean} allSessions - If false, returns test sessions for current user. Otherwise, it returns test sessions for all users - * @param {boolean} includeAllProperties - If true, it returns all properties of the test sessions. Otherwise, it returns the skinny version. - * @param {TestInterfaces.TestSessionSource} source - Source of the test session. - * @param {boolean} includeOnlyCompletedSessions - If true, it returns test sessions in completed state. Otherwise, it returns test sessions for all states + * @param {string} project - Project ID or project name + * @param {number} runId - ID of the test run that contains the result. + * @param {number} testCaseResultId - ID of the test result that contains the iterations. + * @param {number} iterationId - Id of the test results Iteration. + * @param {boolean} includeActionResults - Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration. */ - getTestSessions(teamContext, period, allSessions, includeAllProperties, source, includeOnlyCompletedSessions) { + getTestIteration(project, runId, testCaseResultId, iterationId, includeActionResults) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + runId: runId, + testCaseResultId: testCaseResultId, + iterationId: iterationId }; let queryValues = { - period: period, - allSessions: allSessions, - includeAllProperties: includeAllProperties, - source: source, - includeOnlyCompletedSessions: includeOnlyCompletedSessions, + includeActionResults: includeActionResults, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "73eb9074-3446-4c44-8296-2f811950ff8d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestSession, true); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestIterationDetailsModel, false); resolve(ret); } catch (err) { @@ -28414,31 +30161,31 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Update a test session + * Get iterations for a result * - * @param {TestInterfaces.TestSession} testSession - Test session details for update - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} project - Project ID or project name + * @param {number} runId - ID of the test run that contains the result. + * @param {number} testCaseResultId - ID of the test result that contains the iterations. + * @param {boolean} includeActionResults - Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration. */ - updateTestSession(testSession, teamContext) { + getTestIterations(project, runId, testCaseResultId, includeActionResults) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + runId: runId, + testCaseResultId: testCaseResultId + }; + let queryValues = { + includeActionResults: includeActionResults, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "73eb9074-3446-4c44-8296-2f811950ff8d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, testSession, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestSession, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestIterationDetailsModel, true); resolve(ret); } catch (err) { @@ -28448,23 +30195,22 @@ class TestApi extends basem.ClientApiBase { }); } /** + * @param {TestInterfaces.LinkedWorkItemsQuery} workItemQuery * @param {string} project - Project ID or project name - * @param {number} sharedParameterId */ - deleteSharedParameter(project, sharedParameterId) { + getLinkedWorkItemsByQuery(workItemQuery, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - sharedParameterId: sharedParameterId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "8300eeca-0f8c-4eff-a089-d2dda409c41f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "a4dcb25b-9878-49ea-abfd-e440bd9b1dcd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, workItemQuery, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -28474,23 +30220,25 @@ class TestApi extends basem.ClientApiBase { }); } /** + * Get test run message logs + * * @param {string} project - Project ID or project name - * @param {number} sharedStepId + * @param {number} runId - ID of the run to get. */ - deleteSharedStep(project, sharedStepId) { + getTestRunLogs(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - sharedStepId: sharedStepId + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "fabb3cc9-e3f8-40b7-8b62-24cc4b73fccf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "a1e55200-637e-42e9-a7c0-7e5bfdedb1b3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestMessageLogDetails, true); resolve(ret); } catch (err) { @@ -28500,30 +30248,33 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Add test cases to suite. + * Get a test point. * * @param {string} project - Project ID or project name - * @param {number} planId - ID of the test plan that contains the suite. - * @param {number} suiteId - ID of the test suite to which the test cases must be added. - * @param {string} testCaseIds - IDs of the test cases to add to the suite. Ids are specified in comma separated format. + * @param {number} planId - ID of the test plan. + * @param {number} suiteId - ID of the suite that contains the point. + * @param {number} pointIds - ID of the test point to get. + * @param {string} witFields - Comma-separated list of work item field names. */ - addTestCasesToSuite(project, planId, suiteId, testCaseIds) { + getPoint(project, planId, suiteId, pointIds, witFields) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - action: "TestCases", project: project, planId: planId, suiteId: suiteId, - testCaseIds: testCaseIds + pointIds: pointIds + }; + let queryValues = { + witFields: witFields, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "a4a1ec1c-b03f-41ca-8857-704594ecf58e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "3bcfd5c8-be62-488e-b1da-b8289ce9299c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPoint, false); resolve(ret); } catch (err) { @@ -28533,61 +30284,43 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get a specific test case in a test suite with test case id. + * Get a list of test points. * * @param {string} project - Project ID or project name - * @param {number} planId - ID of the test plan that contains the suites. - * @param {number} suiteId - ID of the suite that contains the test case. - * @param {number} testCaseIds - ID of the test case to get. + * @param {number} planId - ID of the test plan. + * @param {number} suiteId - ID of the suite that contains the points. + * @param {string} witFields - Comma-separated list of work item field names. + * @param {string} configurationId - Get test points for specific configuration. + * @param {string} testCaseId - Get test points for a specific test case, valid when configurationId is not set. + * @param {string} testPointIds - Get test points for comma-separated list of test point IDs, valid only when configurationId and testCaseId are not set. + * @param {boolean} includePointDetails - Include all properties for the test point. + * @param {number} skip - Number of test points to skip.. + * @param {number} top - Number of test points to return. */ - getTestCaseById(project, planId, suiteId, testCaseIds) { + getPoints(project, planId, suiteId, witFields, configurationId, testCaseId, testPointIds, includePointDetails, skip, top) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - action: "TestCases", project: project, planId: planId, - suiteId: suiteId, - testCaseIds: testCaseIds + suiteId: suiteId }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "a4a1ec1c-b03f-41ca-8857-704594ecf58e", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); - }); - } - /** - * Get all test cases in a suite. - * - * @param {string} project - Project ID or project name - * @param {number} planId - ID of the test plan that contains the suites. - * @param {number} suiteId - ID of the suite to get. - */ - getTestCases(project, planId, suiteId) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - action: "TestCases", - project: project, - planId: planId, - suiteId: suiteId + let queryValues = { + witFields: witFields, + configurationId: configurationId, + testCaseId: testCaseId, + testPointIds: testPointIds, + includePointDetails: includePointDetails, + '$skip': skip, + '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "a4a1ec1c-b03f-41ca-8857-704594ecf58e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "3bcfd5c8-be62-488e-b1da-b8289ce9299c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPoint, true); resolve(ret); } catch (err) { @@ -28597,30 +30330,30 @@ class TestApi extends basem.ClientApiBase { }); } /** - * The test points associated with the test cases are removed from the test suite. The test case work item is not deleted from the system. See test cases resource to delete a test case permanently. + * Update test points. * + * @param {TestInterfaces.PointUpdateModel} pointUpdateModel - Data to update. * @param {string} project - Project ID or project name - * @param {number} planId - ID of the test plan that contains the suite. - * @param {number} suiteId - ID of the suite to get. - * @param {string} testCaseIds - IDs of the test cases to remove from the suite. + * @param {number} planId - ID of the test plan. + * @param {number} suiteId - ID of the suite that contains the points. + * @param {string} pointIds - ID of the test point to get. Use a comma-separated list of IDs to update multiple test points. */ - removeTestCasesFromSuiteUrl(project, planId, suiteId, testCaseIds) { + updateTestPoints(pointUpdateModel, project, planId, suiteId, pointIds) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - action: "TestCases", project: project, planId: planId, suiteId: suiteId, - testCaseIds: testCaseIds + pointIds: pointIds }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "a4a1ec1c-b03f-41ca-8857-704594ecf58e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "3bcfd5c8-be62-488e-b1da-b8289ce9299c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, pointUpdateModel, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPoint, true); resolve(ret); } catch (err) { @@ -28630,59 +30363,30 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Updates the properties of the test case association in a suite. + * Get test points using query. * - * @param {TestInterfaces.SuiteTestCaseUpdateModel} suiteTestCaseUpdateModel - Model for updation of the properties of test case suite association. + * @param {TestInterfaces.TestPointsQuery} query - TestPointsQuery to get test points. * @param {string} project - Project ID or project name - * @param {number} planId - ID of the test plan that contains the suite. - * @param {number} suiteId - ID of the test suite to which the test cases must be added. - * @param {string} testCaseIds - IDs of the test cases to add to the suite. Ids are specified in comma separated format. + * @param {number} skip - Number of test points to skip.. + * @param {number} top - Number of test points to return. */ - updateSuiteTestCases(suiteTestCaseUpdateModel, project, planId, suiteId, testCaseIds) { + getPointsByQuery(query, project, skip, top) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - action: "TestCases", - project: project, - planId: planId, - suiteId: suiteId, - testCaseIds: testCaseIds + project: project }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "Test", "a4a1ec1c-b03f-41ca-8857-704594ecf58e", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.update(url, suiteTestCaseUpdateModel, options); - let ret = this.formatResponse(res.result, null, true); - resolve(ret); - } - catch (err) { - reject(err); - } - })); - }); - } - /** - * Delete a test case. - * - * @param {string} project - Project ID or project name - * @param {number} testCaseId - Id of test case to delete. - */ - deleteTestCase(project, testCaseId) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - testCaseId: testCaseId + let queryValues = { + '$skip': skip, + '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "4d472e0f-e32c-4ef8-adf4-a4078772889c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "b4264fd0-a5d1-43e2-82a5-b9c46b7da9ce", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, query, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestPointsQuery, false); resolve(ret); } catch (err) { @@ -28692,24 +30396,40 @@ class TestApi extends basem.ClientApiBase { }); } /** - * Get history of a test method using TestHistoryQuery - * - * @param {TestInterfaces.TestHistoryQuery} filter - TestHistoryQuery to get history * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} publishContext + * @param {string} groupBy + * @param {string} filter + * @param {string} orderby + * @param {boolean} shouldIncludeResults + * @param {boolean} queryRunSummaryForInProgress */ - queryTestHistory(filter, project) { + getTestResultDetailsForBuild(project, buildId, publishContext, groupBy, filter, orderby, shouldIncludeResults, queryRunSummaryForInProgress) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + buildId: buildId, + publishContext: publishContext, + groupBy: groupBy, + '$filter': filter, + '$orderby': orderby, + shouldIncludeResults: shouldIncludeResults, + queryRunSummaryForInProgress: queryRunSummaryForInProgress, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "Test", "929fd86c-3e38-4d8c-b4b6-90df256e5971", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "efb387b0-10d5-42e7-be40-95e06ee9430f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, filter, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestHistoryQuery, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultsDetails, false); resolve(ret); } catch (err) { @@ -28719,22 +30439,45 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {TestInterfaces.TestSettings} testSettings * @param {string} project - Project ID or project name + * @param {number} releaseId + * @param {number} releaseEnvId + * @param {string} publishContext + * @param {string} groupBy + * @param {string} filter + * @param {string} orderby + * @param {boolean} shouldIncludeResults + * @param {boolean} queryRunSummaryForInProgress */ - createTestSettings(testSettings, project) { + getTestResultDetailsForRelease(project, releaseId, releaseEnvId, publishContext, groupBy, filter, orderby, shouldIncludeResults, queryRunSummaryForInProgress) { return __awaiter(this, void 0, void 0, function* () { + if (releaseId == null) { + throw new TypeError('releaseId can not be null or undefined'); + } + if (releaseEnvId == null) { + throw new TypeError('releaseEnvId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + releaseId: releaseId, + releaseEnvId: releaseEnvId, + publishContext: publishContext, + groupBy: groupBy, + '$filter': filter, + '$orderby': orderby, + shouldIncludeResults: shouldIncludeResults, + queryRunSummaryForInProgress: queryRunSummaryForInProgress, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "8133ce14-962f-42af-a5f9-6aa9defcb9c8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "b834ec7e-35bb-450f-a3c8-802e70ca40dd", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, testSettings, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultsDetails, false); resolve(ret); } catch (err) { @@ -28744,22 +30487,23 @@ class TestApi extends basem.ClientApiBase { }); } /** + * @param {TestInterfaces.TestResultDocument} document * @param {string} project - Project ID or project name - * @param {number} testSettingsId + * @param {number} runId */ - deleteTestSettings(project, testSettingsId) { + publishTestResultDocument(document, project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - testSettingsId: testSettingsId + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "8133ce14-962f-42af-a5f9-6aa9defcb9c8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "370ca04b-8eec-4ca8-8ba3-d24dca228791", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.create(url, document, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -28771,22 +30515,36 @@ class TestApi extends basem.ClientApiBase { } /** * @param {string} project - Project ID or project name - * @param {number} testSettingsId + * @param {number} buildId + * @param {string} publishContext + * @param {string[]} fields + * @param {string} continuationToken */ - getTestSettingsById(project, testSettingsId) { + getResultGroupsByBuild(project, buildId, publishContext, fields, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } + if (publishContext == null) { + throw new TypeError('publishContext can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - testSettingsId: testSettingsId + project: project + }; + let queryValues = { + buildId: buildId, + publishContext: publishContext, + fields: fields && fields.join(","), + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "8133ce14-962f-42af-a5f9-6aa9defcb9c8", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "d279d052-c55a-4204-b913-42f733b52958", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -28796,22 +30554,39 @@ class TestApi extends basem.ClientApiBase { }); } /** - * @param {TestInterfaces.WorkItemToTestLinks} workItemToTestLinks * @param {string} project - Project ID or project name + * @param {number} releaseId + * @param {string} publishContext + * @param {number} releaseEnvId + * @param {string[]} fields + * @param {string} continuationToken */ - addWorkItemToTestLinks(workItemToTestLinks, project) { + getResultGroupsByRelease(project, releaseId, publishContext, releaseEnvId, fields, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (releaseId == null) { + throw new TypeError('releaseId can not be null or undefined'); + } + if (publishContext == null) { + throw new TypeError('publishContext can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + releaseId: releaseId, + publishContext: publishContext, + releaseEnvId: releaseEnvId, + fields: fields && fields.join(","), + continuationToken: continuationToken, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "371b1655-ce05-412e-a113-64cc77bb78d2", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "ef5ce5d4-a4e5-47ee-804c-354518f8d03f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, workItemToTestLinks, options); - let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.WorkItemToTestLinks, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -28821,33 +30596,24 @@ class TestApi extends basem.ClientApiBase { }); } /** + * Get list of test Result meta data details for corresponding testcasereferenceId + * + * @param {string[]} testReferenceIds - TestCaseReference Ids of the test Result to be queried, comma separated list of valid ids (limit no. of ids 200). * @param {string} project - Project ID or project name - * @param {string} testName - * @param {number} workItemId */ - deleteTestMethodToWorkItemLink(project, testName, workItemId) { + queryTestResultsMetaData(testReferenceIds, project) { return __awaiter(this, void 0, void 0, function* () { - if (testName == null) { - throw new TypeError('testName can not be null or undefined'); - } - if (workItemId == null) { - throw new TypeError('workItemId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; - let queryValues = { - testName: testName, - workItemId: workItemId, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "7b0bdee3-a354-47f9-a42c-89018d7808d5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "afa7830e-67a7-4336-8090-2b448ca80295", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, testReferenceIds, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -28857,28 +30623,23 @@ class TestApi extends basem.ClientApiBase { }); } /** + * Get test result retention settings + * * @param {string} project - Project ID or project name - * @param {string} testName */ - queryTestMethodLinkedWorkItems(project, testName) { + getResultRetentionSettings(project) { return __awaiter(this, void 0, void 0, function* () { - if (testName == null) { - throw new TypeError('testName can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; - let queryValues = { - testName: testName, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "7b0bdee3-a354-47f9-a42c-89018d7808d5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "a3206d9e-fa8d-42d3-88cb-f75c51e69cde", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.ResultRetentionSettings, false); resolve(ret); } catch (err) { @@ -28888,38 +30649,24 @@ class TestApi extends basem.ClientApiBase { }); } /** + * Update test result retention settings + * + * @param {TestInterfaces.ResultRetentionSettings} retentionSettings - Test result retention settings details to be updated * @param {string} project - Project ID or project name - * @param {string} workItemCategory - * @param {string} automatedTestName - * @param {number} testCaseId - * @param {Date} maxCompleteDate - * @param {number} days - * @param {number} workItemCount */ - queryTestResultWorkItems(project, workItemCategory, automatedTestName, testCaseId, maxCompleteDate, days, workItemCount) { + updateResultRetentionSettings(retentionSettings, project) { return __awaiter(this, void 0, void 0, function* () { - if (workItemCategory == null) { - throw new TypeError('workItemCategory can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; - let queryValues = { - workItemCategory: workItemCategory, - automatedTestName: automatedTestName, - testCaseId: testCaseId, - maxCompleteDate: maxCompleteDate, - days: days, - '$workItemCount': workItemCount, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "Test", "926ff5dc-137f-45f0-bd51-9412fa9810ce", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "a3206d9e-fa8d-42d3-88cb-f75c51e69cde", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.update(url, retentionSettings, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.ResultRetentionSettings, false); resolve(ret); } catch (err) { @@ -28928,71 +30675,27 @@ class TestApi extends basem.ClientApiBase { })); }); } -} -TestApi.RESOURCE_AREA_ID = "c2aa639c-3ccc-4740-b3b6-ce2a1e1d984e"; -exports.TestApi = TestApi; - - -/***/ }), - -/***/ 5417: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const TfvcInterfaces = __nccwpck_require__(9003); -class TfvcApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Tfvc-api', options); - } /** - * Get a single branch hierarchy at the given path with parents or children as specified. + * Add test results to a test run. * - * @param {string} path - Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder. + * @param {TestInterfaces.TestCaseResult[]} results - List of test results to add. * @param {string} project - Project ID or project name - * @param {boolean} includeParent - Return the parent branch, if there is one. Default: False - * @param {boolean} includeChildren - Return child branches, if there are any. Default: False + * @param {number} runId - Test run ID into which test results to add. */ - getBranch(path, project, includeParent, includeChildren) { + addTestResultsToTestRun(results, project, runId) { return __awaiter(this, void 0, void 0, function* () { - if (path == null) { - throw new TypeError('path can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - path: path, - includeParent: includeParent, - includeChildren: includeChildren, + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "bc1f417e-239d-42e7-85e1-76e80cb2d6eb", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.6", "Test", "4637d869-3a76-4468-8057-0bb02aa385cf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcBranch, false); + res = yield this.rest.create(url, results, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -29002,33 +30705,31 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get a collection of branch roots -- first-level children, branches with no parents. + * Get a test result for a test run. * * @param {string} project - Project ID or project name - * @param {boolean} includeParent - Return the parent branch, if there is one. Default: False - * @param {boolean} includeChildren - Return the child branches for each root branch. Default: False - * @param {boolean} includeDeleted - Return deleted branches. Default: False - * @param {boolean} includeLinks - Return links. Default: False + * @param {number} runId - Test run ID of a test result to fetch. + * @param {number} testCaseResultId - Test result ID. + * @param {TestInterfaces.ResultDetails} detailsToInclude - Details to include with test results. Default is None. Other values are Iterations, WorkItems and SubResults. */ - getBranches(project, includeParent, includeChildren, includeDeleted, includeLinks) { + getTestResultById(project, runId, testCaseResultId, detailsToInclude) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId, + testCaseResultId: testCaseResultId }; let queryValues = { - includeParent: includeParent, - includeChildren: includeChildren, - includeDeleted: includeDeleted, - includeLinks: includeLinks, + detailsToInclude: detailsToInclude, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "bc1f417e-239d-42e7-85e1-76e80cb2d6eb", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.6", "Test", "4637d869-3a76-4468-8057-0bb02aa385cf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcBranch, true); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestCaseResult, false); resolve(ret); } catch (err) { @@ -29038,34 +30739,35 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get branch hierarchies below the specified scopePath + * Get test results for a test run. * - * @param {string} scopePath - Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder. * @param {string} project - Project ID or project name - * @param {boolean} includeDeleted - Return deleted branches. Default: False - * @param {boolean} includeLinks - Return links. Default: False + * @param {number} runId - Test run ID of test results to fetch. + * @param {TestInterfaces.ResultDetails} detailsToInclude - Details to include with test results. Default is None. Other values are Iterations and WorkItems. + * @param {number} skip - Number of test results to skip from beginning. + * @param {number} top - Number of test results to return. Maximum is 1000 when detailsToInclude is None and 200 otherwise. + * @param {TestInterfaces.TestOutcome[]} outcomes - Comma separated list of test outcomes to filter test results. */ - getBranchRefs(scopePath, project, includeDeleted, includeLinks) { + getTestResults(project, runId, detailsToInclude, skip, top, outcomes) { return __awaiter(this, void 0, void 0, function* () { - if (scopePath == null) { - throw new TypeError('scopePath can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId }; let queryValues = { - scopePath: scopePath, - includeDeleted: includeDeleted, - includeLinks: includeLinks, + detailsToInclude: detailsToInclude, + '$skip': skip, + '$top': top, + outcomes: outcomes && outcomes.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "bc1f417e-239d-42e7-85e1-76e80cb2d6eb", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.6", "Test", "4637d869-3a76-4468-8057-0bb02aa385cf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcBranchRef, true); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -29075,29 +30777,26 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Retrieve Tfvc changes for a given changeset. + * Update test results in a test run. * - * @param {number} id - ID of the changeset. Default: null - * @param {number} skip - Number of results to skip. Default: null - * @param {number} top - The maximum number of results to return. Default: null + * @param {TestInterfaces.TestCaseResult[]} results - List of test results to update. + * @param {string} project - Project ID or project name + * @param {number} runId - Test run ID whose test results to update. */ - getChangesetChanges(id, skip, top) { + updateTestResults(results, project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - id: id - }; - let queryValues = { - '$skip': skip, - '$top': top, + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "f32b86f2-15b9-4fe6-81b1-6f8938617ee5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.6", "Test", "4637d869-3a76-4468-8057-0bb02aa385cf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChange, true); + res = yield this.rest.update(url, results, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -29107,24 +30806,24 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Create a new changeset. + * This API will return results by Ids with fields specified/trend for particular automated test method. We are still improving this API and have not finalized proper signature and contract. * - * @param {TfvcInterfaces.TfvcChangeset} changeset + * @param {TestInterfaces.TestResultsQuery} query * @param {string} project - Project ID or project name */ - createChangeset(changeset, project) { + getTestResultsByQuery(query, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "tfvc", "0bc8f0a4-6bfb-42a9-ba84-139da7b99c49", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.6", "Test", "6711da49-8e6f-4d35-9f73-cef7a3c81a5b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, changeset, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangesetRef, false); + res = yield this.rest.create(url, query, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultsQuery, false); resolve(ret); } catch (err) { @@ -29134,45 +30833,36 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Retrieve a Tfvc Changeset - * - * @param {number} id - Changeset Id to retrieve. * @param {string} project - Project ID or project name - * @param {number} maxChangeCount - Number of changes to return (maximum 100 changes) Default: 0 - * @param {boolean} includeDetails - Include policy details and check-in notes in the response. Default: false - * @param {boolean} includeWorkItems - Include workitems. Default: false - * @param {number} maxCommentLength - Include details about associated work items in the response. Default: null - * @param {boolean} includeSourceRename - Include renames. Default: false - * @param {number} skip - Number of results to skip. Default: null - * @param {number} top - The maximum number of results to return. Default: null - * @param {string} orderby - Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order. - * @param {TfvcInterfaces.TfvcChangesetSearchCriteria} searchCriteria - Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null + * @param {number} buildId + * @param {string} publishContext + * @param {TestInterfaces.TestOutcome[]} outcomes + * @param {number} top + * @param {string} continuationToken */ - getChangeset(id, project, maxChangeCount, includeDetails, includeWorkItems, maxCommentLength, includeSourceRename, skip, top, orderby, searchCriteria) { + getTestResultsByBuild(project, buildId, publishContext, outcomes, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - id: id + project: project }; let queryValues = { - maxChangeCount: maxChangeCount, - includeDetails: includeDetails, - includeWorkItems: includeWorkItems, - maxCommentLength: maxCommentLength, - includeSourceRename: includeSourceRename, - '$skip': skip, + buildId: buildId, + publishContext: publishContext, + outcomes: outcomes && outcomes.join(","), '$top': top, - '$orderby': orderby, - searchCriteria: searchCriteria, + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "tfvc", "0bc8f0a4-6bfb-42a9-ba84-139da7b99c49", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "3c191b88-615b-4be2-b7d9-5ff9141e91d4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangeset, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -29182,35 +30872,38 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Retrieve Tfvc Changesets - * * @param {string} project - Project ID or project name - * @param {number} maxCommentLength - Include details about associated work items in the response. Default: null - * @param {number} skip - Number of results to skip. Default: null - * @param {number} top - The maximum number of results to return. Default: null - * @param {string} orderby - Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order. - * @param {TfvcInterfaces.TfvcChangesetSearchCriteria} searchCriteria - Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null + * @param {number} releaseId + * @param {number} releaseEnvid + * @param {string} publishContext + * @param {TestInterfaces.TestOutcome[]} outcomes + * @param {number} top + * @param {string} continuationToken */ - getChangesets(project, maxCommentLength, skip, top, orderby, searchCriteria) { + getTestResultsByRelease(project, releaseId, releaseEnvid, publishContext, outcomes, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (releaseId == null) { + throw new TypeError('releaseId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; let queryValues = { - maxCommentLength: maxCommentLength, - '$skip': skip, + releaseId: releaseId, + releaseEnvid: releaseEnvid, + publishContext: publishContext, + outcomes: outcomes && outcomes.join(","), '$top': top, - '$orderby': orderby, - searchCriteria: searchCriteria, + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "tfvc", "0bc8f0a4-6bfb-42a9-ba84-139da7b99c49", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "ce01820b-83f3-4c15-a583-697a43292c4e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangesetRef, true); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -29220,21 +30913,34 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Returns changesets for a given list of changeset Ids. - * - * @param {TfvcInterfaces.TfvcChangesetsRequestData} changesetsRequestData - List of changeset IDs. + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} publishContext + * @param {boolean} includeFailureDetails + * @param {TestInterfaces.BuildReference} buildToCompare */ - getBatchedChangesets(changesetsRequestData) { + queryTestResultsReportForBuild(project, buildId, publishContext, includeFailureDetails, buildToCompare) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project + }; + let queryValues = { + buildId: buildId, + publishContext: publishContext, + includeFailureDetails: includeFailureDetails, + buildToCompare: buildToCompare, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "b7e7c173-803c-4fea-9ec8-31ee35c5502a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "000ef77b-fea2-498d-a10d-ad1a037f559f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, changesetsRequestData, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangesetRef, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultSummary, false); resolve(ret); } catch (err) { @@ -29244,23 +30950,39 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Retrieves the work items associated with a particular changeset. - * - * @param {number} id - ID of the changeset. + * @param {string} project - Project ID or project name + * @param {number} releaseId + * @param {number} releaseEnvId + * @param {string} publishContext + * @param {boolean} includeFailureDetails + * @param {TestInterfaces.ReleaseReference} releaseToCompare */ - getChangesetWorkItems(id) { + queryTestResultsReportForRelease(project, releaseId, releaseEnvId, publishContext, includeFailureDetails, releaseToCompare) { return __awaiter(this, void 0, void 0, function* () { + if (releaseId == null) { + throw new TypeError('releaseId can not be null or undefined'); + } + if (releaseEnvId == null) { + throw new TypeError('releaseEnvId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - id: id + project: project + }; + let queryValues = { + releaseId: releaseId, + releaseEnvId: releaseEnvId, + publishContext: publishContext, + includeFailureDetails: includeFailureDetails, + releaseToCompare: releaseToCompare, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "64ae0bea-1d71-47c9-a9e5-fe73f5ea0ff4", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "85765790-ac68-494e-b268-af36c3929744", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultSummary, false); resolve(ret); } catch (err) { @@ -29270,24 +30992,22 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. - * - * @param {TfvcInterfaces.TfvcItemRequestData} itemRequestData + * @param {TestInterfaces.ReleaseReference[]} releases * @param {string} project - Project ID or project name */ - getItemsBatch(itemRequestData, project) { + queryTestResultsSummaryForReleases(releases, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "fe6f827b-5f64-480f-b8af-1eca3b80e833", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "85765790-ac68-494e-b268-af36c3929744", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, itemRequestData, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, true); + res = yield this.rest.create(url, releases, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestResultSummary, true); resolve(ret); } catch (err) { @@ -29297,23 +31017,27 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. - * - * @param {TfvcInterfaces.TfvcItemRequestData} itemRequestData + * @param {TestInterfaces.TestResultsContext} resultsContext * @param {string} project - Project ID or project name + * @param {number[]} workItemIds */ - getItemsBatchZip(itemRequestData, project) { + queryTestSummaryByRequirement(resultsContext, project, workItemIds) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + workItemIds: workItemIds && workItemIds.join(","), + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "fe6f827b-5f64-480f-b8af-1eca3b80e833", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "cd08294e-308d-4460-a46e-4cfdefba0b4b", routeValues, queryValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, resultsContext, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestSummaryForWorkItem, true); + resolve(ret); } catch (err) { reject(err); @@ -29322,42 +31046,22 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} path - Version control path of an individual item to return. + * @param {TestInterfaces.TestResultTrendFilter} filter * @param {string} project - Project ID or project name - * @param {string} fileName - file name of item returned. - * @param {boolean} download - If true, create a downloadable attachment. - * @param {string} scopePath - Version control path of a folder to return multiple items. - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder). - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null. - * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. */ - getItem(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) { + queryResultTrendForBuild(filter, project) { return __awaiter(this, void 0, void 0, function* () { - if (path == null) { - throw new TypeError('path can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; - let queryValues = { - path: path, - fileName: fileName, - download: download, - scopePath: scopePath, - recursionLevel: recursionLevel, - versionDescriptor: versionDescriptor, - includeContent: includeContent, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "fbc82a85-0786-4442-88bb-eb0fda6b01b0", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, false); + res = yield this.rest.create(url, filter, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.AggregatedDataForResultTrend, true); resolve(ret); } catch (err) { @@ -29367,41 +31071,23 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} path - Version control path of an individual item to return. + * @param {TestInterfaces.TestResultTrendFilter} filter * @param {string} project - Project ID or project name - * @param {string} fileName - file name of item returned. - * @param {boolean} download - If true, create a downloadable attachment. - * @param {string} scopePath - Version control path of a folder to return multiple items. - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder). - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null. - * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. */ - getItemContent(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) { + queryResultTrendForRelease(filter, project) { return __awaiter(this, void 0, void 0, function* () { - if (path == null) { - throw new TypeError('path can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; - let queryValues = { - path: path, - fileName: fileName, - download: download, - scopePath: scopePath, - recursionLevel: recursionLevel, - versionDescriptor: versionDescriptor, - includeContent: includeContent, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "dd178e93-d8dd-4887-9635-d6b9560b7b6e", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, filter, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.AggregatedDataForResultTrend, true); + resolve(ret); } catch (err) { reject(err); @@ -29410,33 +31096,25 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get a list of Tfvc items + * Get test run statistics , used when we want to get summary of a run by outcome. * * @param {string} project - Project ID or project name - * @param {string} scopePath - Version control path of a folder to return multiple items. - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder). - * @param {boolean} includeLinks - True to include links. - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor + * @param {number} runId - ID of the run to get. */ - getItems(project, scopePath, recursionLevel, includeLinks, versionDescriptor) { + getTestRunStatistics(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - scopePath: scopePath, - recursionLevel: recursionLevel, - includeLinks: includeLinks, - versionDescriptor: versionDescriptor, + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "0a42c424-d764-4a16-a2d5-5c85f87d0ae8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, true); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRunStatistic, false); resolve(ret); } catch (err) { @@ -29446,41 +31124,25 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * Create new test run. * - * @param {string} path - Version control path of an individual item to return. + * @param {TestInterfaces.RunCreateModel} testRun - Run details RunCreateModel * @param {string} project - Project ID or project name - * @param {string} fileName - file name of item returned. - * @param {boolean} download - If true, create a downloadable attachment. - * @param {string} scopePath - Version control path of a folder to return multiple items. - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder). - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null. - * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. */ - getItemText(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) { + createTestRun(testRun, project) { return __awaiter(this, void 0, void 0, function* () { - if (path == null) { - throw new TypeError('path can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; - let queryValues = { - path: path, - fileName: fileName, - download: download, - scopePath: scopePath, - recursionLevel: recursionLevel, - versionDescriptor: versionDescriptor, - includeContent: includeContent, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, testRun, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRun, false); + resolve(ret); } catch (err) { reject(err); @@ -29489,41 +31151,26 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. + * Delete a test run by its ID. * - * @param {string} path - Version control path of an individual item to return. * @param {string} project - Project ID or project name - * @param {string} fileName - file name of item returned. - * @param {boolean} download - If true, create a downloadable attachment. - * @param {string} scopePath - Version control path of a folder to return multiple items. - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder). - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null. - * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. + * @param {number} runId - ID of the run to delete. */ - getItemZip(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) { + deleteTestRun(project, runId) { return __awaiter(this, void 0, void 0, function* () { - if (path == null) { - throw new TypeError('path can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - path: path, - fileName: fileName, - download: download, - scopePath: scopePath, - recursionLevel: recursionLevel, - versionDescriptor: versionDescriptor, - includeContent: includeContent, + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); } catch (err) { reject(err); @@ -29532,29 +31179,29 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get items under a label. + * Get a test run by its ID. * - * @param {string} labelId - Unique identifier of label - * @param {number} top - Max number of items to return - * @param {number} skip - Number of items to skip + * @param {string} project - Project ID or project name + * @param {number} runId - ID of the run to get. + * @param {boolean} includeDetails - Default value is true. It includes details like run statistics, release, build, test environment, post process state, and more. */ - getLabelItems(labelId, top, skip) { + getTestRunById(project, runId, includeDetails) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - labelId: labelId + project: project, + runId: runId }; let queryValues = { - '$top': top, - '$skip': skip, + includeDetails: includeDetails, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "06166e34-de17-4b60-8cd1-23182a346fda", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, true); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRun, false); resolve(ret); } catch (err) { @@ -29564,32 +31211,41 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get a single deep label. + * Get a list of test runs. * - * @param {string} labelId - Unique identifier of label - * @param {TfvcInterfaces.TfvcLabelRequestData} requestData - maxItemCount * @param {string} project - Project ID or project name + * @param {string} buildUri - URI of the build that the runs used. + * @param {string} owner - Team foundation ID of the owner of the runs. + * @param {string} tmiRunId + * @param {number} planId - ID of the test plan that the runs are a part of. + * @param {boolean} includeRunDetails - If true, include all the properties of the runs. + * @param {boolean} automated - If true, only returns automated runs. + * @param {number} skip - Number of test runs to skip. + * @param {number} top - Number of test runs to return. */ - getLabel(labelId, requestData, project) { + getTestRuns(project, buildUri, owner, tmiRunId, planId, includeRunDetails, automated, skip, top) { return __awaiter(this, void 0, void 0, function* () { - if (requestData == null) { - throw new TypeError('requestData can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - labelId: labelId + project: project }; let queryValues = { - requestData: requestData, + buildUri: buildUri, + owner: owner, + tmiRunId: tmiRunId, + planId: planId, + includeRunDetails: includeRunDetails, + automated: automated, + '$skip': skip, + '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "a5d9bd7f-b661-4d0e-b9be-d9c16affae54", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcLabel, false); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRun, true); resolve(ret); } catch (err) { @@ -29599,34 +31255,63 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get a collection of shallow label references. + * Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate. * - * @param {TfvcInterfaces.TfvcLabelRequestData} requestData - labelScope, name, owner, and itemLabelFilter * @param {string} project - Project ID or project name - * @param {number} top - Max number of labels to return, defaults to 100 when undefined - * @param {number} skip - Number of labels to skip + * @param {Date} minLastUpdatedDate - Minimum Last Modified Date of run to be queried (Mandatory). + * @param {Date} maxLastUpdatedDate - Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days). + * @param {TestInterfaces.TestRunState} state - Current state of the Runs to be queried. + * @param {number[]} planIds - Plan Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). + * @param {boolean} isAutomated - Automation type of the Runs to be queried. + * @param {TestInterfaces.TestRunPublishContext} publishContext - PublishContext of the Runs to be queried. + * @param {number[]} buildIds - Build Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). + * @param {number[]} buildDefIds - Build Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). + * @param {string} branchName - Source Branch name of the Runs to be queried. + * @param {number[]} releaseIds - Release Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). + * @param {number[]} releaseDefIds - Release Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). + * @param {number[]} releaseEnvIds - Release Environment Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). + * @param {number[]} releaseEnvDefIds - Release Environment Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10). + * @param {string} runTitle - Run Title of the Runs to be queried. + * @param {number} top - Number of runs to be queried. Limit is 100 + * @param {string} continuationToken - continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user. */ - getLabels(requestData, project, top, skip) { + queryTestRuns(project, minLastUpdatedDate, maxLastUpdatedDate, state, planIds, isAutomated, publishContext, buildIds, buildDefIds, branchName, releaseIds, releaseDefIds, releaseEnvIds, releaseEnvDefIds, runTitle, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { - if (requestData == null) { - throw new TypeError('requestData can not be null or undefined'); + if (minLastUpdatedDate == null) { + throw new TypeError('minLastUpdatedDate can not be null or undefined'); + } + if (maxLastUpdatedDate == null) { + throw new TypeError('maxLastUpdatedDate can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; let queryValues = { - requestData: requestData, + minLastUpdatedDate: minLastUpdatedDate, + maxLastUpdatedDate: maxLastUpdatedDate, + state: state, + planIds: planIds && planIds.join(","), + isAutomated: isAutomated, + publishContext: publishContext, + buildIds: buildIds && buildIds.join(","), + buildDefIds: buildDefIds && buildDefIds.join(","), + branchName: branchName, + releaseIds: releaseIds && releaseIds.join(","), + releaseDefIds: releaseDefIds && releaseDefIds.join(","), + releaseEnvIds: releaseEnvIds && releaseEnvIds.join(","), + releaseEnvDefIds: releaseEnvDefIds && releaseEnvDefIds.join(","), + runTitle: runTitle, '$top': top, - '$skip': skip, + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "a5d9bd7f-b661-4d0e-b9be-d9c16affae54", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcLabelRef, true); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRun, true); resolve(ret); } catch (err) { @@ -29636,31 +31321,26 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get changes included in a shelveset. + * Update test run by its ID. * - * @param {string} shelvesetId - Shelveset's unique ID - * @param {number} top - Max number of changes to return - * @param {number} skip - Number of changes to skip + * @param {TestInterfaces.RunUpdateModel} runUpdateModel - Run details RunUpdateModel + * @param {string} project - Project ID or project name + * @param {number} runId - ID of the run to update. */ - getShelvesetChanges(shelvesetId, top, skip) { + updateTestRun(runUpdateModel, project, runId) { return __awaiter(this, void 0, void 0, function* () { - if (shelvesetId == null) { - throw new TypeError('shelvesetId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - shelvesetId: shelvesetId, - '$top': top, - '$skip': skip, + let routeValues = { + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "dbaf075b-0445-4c34-9e5b-82292f856522", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "cadb3810-d47d-4a3c-a234-fe5f3be50138", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChange, true); + res = yield this.rest.update(url, runUpdateModel, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestRun, false); resolve(ret); } catch (err) { @@ -29670,29 +31350,31 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get a single deep shelveset. + * Create a test session * - * @param {string} shelvesetId - Shelveset's unique ID - * @param {TfvcInterfaces.TfvcShelvesetRequestData} requestData - includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength + * @param {TestInterfaces.TestSession} testSession - Test session details for creation + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - getShelveset(shelvesetId, requestData) { + createTestSession(testSession, teamContext) { return __awaiter(this, void 0, void 0, function* () { - if (shelvesetId == null) { - throw new TypeError('shelvesetId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - shelvesetId: shelvesetId, - requestData: requestData, + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "e36d44fb-e907-4b0a-b194-f83f1ed32ad3", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcShelveset, false); + res = yield this.rest.create(url, testSession, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestSession, false); resolve(ret); } catch (err) { @@ -29702,28 +31384,42 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Return a collection of shallow shelveset references. + * Get a list of test sessions * - * @param {TfvcInterfaces.TfvcShelvesetRequestData} requestData - name, owner, and maxCommentLength - * @param {number} top - Max number of shelvesets to return - * @param {number} skip - Number of shelvesets to skip + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {number} period - Period in days from now, for which test sessions are fetched. + * @param {boolean} allSessions - If false, returns test sessions for current user. Otherwise, it returns test sessions for all users + * @param {boolean} includeAllProperties - If true, it returns all properties of the test sessions. Otherwise, it returns the skinny version. + * @param {TestInterfaces.TestSessionSource} source - Source of the test session. + * @param {boolean} includeOnlyCompletedSessions - If true, it returns test sessions in completed state. Otherwise, it returns test sessions for all states */ - getShelvesets(requestData, top, skip) { + getTestSessions(teamContext, period, allSessions, includeAllProperties, source, includeOnlyCompletedSessions) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; let queryValues = { - requestData: requestData, - '$top': top, - '$skip': skip, + period: period, + allSessions: allSessions, + includeAllProperties: includeAllProperties, + source: source, + includeOnlyCompletedSessions: includeOnlyCompletedSessions, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "e36d44fb-e907-4b0a-b194-f83f1ed32ad3", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcShelvesetRef, true); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestSession, true); resolve(ret); } catch (err) { @@ -29733,27 +31429,31 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Get work items associated with a shelveset. + * Update a test session * - * @param {string} shelvesetId - Shelveset's unique ID + * @param {TestInterfaces.TestSession} testSession - Test session details for update + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - getShelvesetWorkItems(shelvesetId) { + updateTestSession(testSession, teamContext) { return __awaiter(this, void 0, void 0, function* () { - if (shelvesetId == null) { - throw new TypeError('shelvesetId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - shelvesetId: shelvesetId, + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "a7a0c1c1-373e-425a-b031-a519474d743d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.update(url, testSession, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestSession, false); resolve(ret); } catch (err) { @@ -29763,22 +31463,110 @@ class TfvcApi extends basem.ClientApiBase { }); } /** - * Provides File Count and Uncompressed Bytes for a Collection/Project at a particular scope for TFVC. + * @param {string} project - Project ID or project name + * @param {number} sharedParameterId + */ + deleteSharedParameter(project, sharedParameterId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + sharedParameterId: sharedParameterId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "8300eeca-0f8c-4eff-a089-d2dda409c41f", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {string} project - Project ID or project name + * @param {number} sharedStepId + */ + deleteSharedStep(project, sharedStepId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + sharedStepId: sharedStepId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "fabb3cc9-e3f8-40b7-8b62-24cc4b73fccf", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Add test cases to suite. * * @param {string} project - Project ID or project name - * @param {string} scopePath - '$/' for collection, '$/project' for specific project + * @param {number} planId - ID of the test plan that contains the suite. + * @param {number} suiteId - ID of the test suite to which the test cases must be added. + * @param {string} testCaseIds - IDs of the test cases to add to the suite. Ids are specified in comma separated format. */ - getTfvcStatistics(project, scopePath) { + addTestCasesToSuite(project, planId, suiteId, testCaseIds) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + action: "TestCases", + project: project, + planId: planId, + suiteId: suiteId, + testCaseIds: testCaseIds }; - let queryValues = { - scopePath: scopePath, + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "a4a1ec1c-b03f-41ca-8857-704594ecf58e", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get a specific test case in a test suite with test case id. + * + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan that contains the suites. + * @param {number} suiteId - ID of the suite that contains the test case. + * @param {number} testCaseIds - ID of the test case to get. + */ + getTestCaseById(project, planId, suiteId, testCaseIds) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + action: "TestCases", + project: project, + planId: planId, + suiteId: suiteId, + testCaseIds: testCaseIds }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "tfvc", "e15c74c0-3605-40e0-aed4-4cc61e549ed8", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "a4a1ec1c-b03f-41ca-8857-704594ecf58e", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -29792,458 +31580,362 @@ class TfvcApi extends basem.ClientApiBase { })); }); } -} -TfvcApi.RESOURCE_AREA_ID = "8aa40520-446d-40e6-89f6-9c9f9ce44c48"; -exports.TfvcApi = TfvcApi; - - -/***/ }), - -/***/ 9686: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -//******************************************************************************************************* -// significant portions of this file copied from: VSO\src\Vssf\WebPlatform\Platform\Scripts\VSS\WebApi\RestClient.ts -//******************************************************************************************************* -Object.defineProperty(exports, "__esModule", ({ value: true })); -/// Imports of 3rd Party /// -const url = __nccwpck_require__(7310); -const path = __nccwpck_require__(1017); -class InvalidApiResourceVersionError { - constructor(message) { - this.name = "Invalid resource version"; - this.message = message; - } -} -exports.InvalidApiResourceVersionError = InvalidApiResourceVersionError; -/** - * Base class that should be used (derived from) to make requests to VSS REST apis - */ -class VsoClient { - constructor(baseUrl, restClient) { - this.baseUrl = baseUrl; - this.basePath = url.parse(baseUrl).pathname; - this.restClient = restClient; - this._locationsByAreaPromises = {}; - this._initializationPromise = Promise.resolve(true); - } - autoNegotiateApiVersion(location, requestedVersion) { - let negotiatedVersion; - let apiVersion; - let apiVersionString; - if (requestedVersion) { - let apiVersionRegEx = new RegExp('(\\d+(\\.\\d+)?)(-preview(\\.(\\d+))?)?'); - // Need to handle 3 types of api versions + invalid apiversion - // '2.1-preview.1' = ["2.1-preview.1", "2.1", ".1", -preview.1", ".1", "1"] - // '2.1-preview' = ["2.1-preview", "2.1", ".1", "-preview", undefined, undefined] - // '2.1' = ["2.1", "2.1", ".1", undefined, undefined, undefined] - let isPreview = false; - let resourceVersion; - let regExExecArray = apiVersionRegEx.exec(requestedVersion); - if (regExExecArray) { - if (regExExecArray[1]) { - // we have an api version - apiVersion = +regExExecArray[1]; - apiVersionString = regExExecArray[1]; - if (regExExecArray[3]) { - // requesting preview - isPreview = true; - if (regExExecArray[5]) { - // we have a resource version - resourceVersion = +regExExecArray[5]; - } - } - // compare the location version and requestedversion - if (apiVersion <= +location.releasedVersion - || (!resourceVersion && apiVersion <= +location.maxVersion && isPreview) - || (resourceVersion && apiVersion <= +location.maxVersion && resourceVersion <= +location.resourceVersion)) { - negotiatedVersion = requestedVersion; - } - // else fall back to latest version of the resource from location + /** + * Get all test cases in a suite. + * + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan that contains the suites. + * @param {number} suiteId - ID of the suite to get. + */ + getTestCases(project, planId, suiteId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + action: "TestCases", + project: project, + planId: planId, + suiteId: suiteId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "a4a1ec1c-b03f-41ca-8857-704594ecf58e", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); } - } - } - if (!negotiatedVersion) { - // Use the latest version of the resource if the api version was not specified in the request or if the requested version is higher then the location's supported version - if (apiVersion < +location.maxVersion) { - negotiatedVersion = apiVersionString + "-preview"; - } - else if (location.maxVersion === location.releasedVersion) { - negotiatedVersion = location.maxVersion; - } - else { - negotiatedVersion = location.maxVersion + "-preview." + location.resourceVersion; - } - } - return negotiatedVersion; + catch (err) { + reject(err); + } + })); + }); } /** - * Gets the route template for a resource based on its location ID and negotiates the api version + * The test points associated with the test cases are removed from the test suite. The test case work item is not deleted from the system. See test cases resource to delete a test case permanently. + * + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan that contains the suite. + * @param {number} suiteId - ID of the suite to get. + * @param {string} testCaseIds - IDs of the test cases to remove from the suite. */ - getVersioningData(apiVersion, area, locationId, routeValues, queryParams) { - let requestUrl; - return this.beginGetLocation(area, locationId) - .then((location) => { - if (!location) { - throw new Error("Failed to find api location for area: " + area + " id: " + locationId); - } - apiVersion = this.autoNegotiateApiVersion(location, apiVersion); - requestUrl = this.getRequestUrl(location.routeTemplate, location.area, location.resourceName, routeValues, queryParams); - return { - apiVersion: apiVersion, - requestUrl: requestUrl - }; + removeTestCasesFromSuiteUrl(project, planId, suiteId, testCaseIds) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + action: "TestCases", + project: project, + planId: planId, + suiteId: suiteId, + testCaseIds: testCaseIds + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "a4a1ec1c-b03f-41ca-8857-704594ecf58e", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); }); } /** - * Sets a promise that is waited on before any requests are issued. Can be used to asynchronously - * set the request url and auth token manager. + * Updates the properties of the test case association in a suite. + * + * @param {TestInterfaces.SuiteTestCaseUpdateModel} suiteTestCaseUpdateModel - Model for updation of the properties of test case suite association. + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan that contains the suite. + * @param {number} suiteId - ID of the test suite to which the test cases must be added. + * @param {string} testCaseIds - IDs of the test cases to add to the suite. Ids are specified in comma separated format. */ - _setInitializationPromise(promise) { - if (promise) { - this._initializationPromise = promise; - } + updateSuiteTestCases(suiteTestCaseUpdateModel, project, planId, suiteId, testCaseIds) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + action: "TestCases", + project: project, + planId: planId, + suiteId: suiteId, + testCaseIds: testCaseIds + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "Test", "a4a1ec1c-b03f-41ca-8857-704594ecf58e", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, suiteTestCaseUpdateModel, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); } /** - * Gets information about an API resource location (route template, supported versions, etc.) + * Delete a test case. * - * @param area resource area name - * @param locationId Guid of the location to get + * @param {string} project - Project ID or project name + * @param {number} testCaseId - Id of test case to delete. */ - beginGetLocation(area, locationId) { - return this._initializationPromise.then(() => { - return this.beginGetAreaLocations(area); - }).then((areaLocations) => { - return areaLocations[(locationId || "").toLowerCase()]; + deleteTestCase(project, testCaseId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + testCaseId: testCaseId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "4d472e0f-e32c-4ef8-adf4-a4078772889c", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); }); } - beginGetAreaLocations(area) { - let areaLocationsPromise = this._locationsByAreaPromises[area]; - if (!areaLocationsPromise) { - let requestUrl = this.resolveUrl(VsoClient.APIS_RELATIVE_PATH + "/" + area); - areaLocationsPromise = this.restClient.options(requestUrl) - .then((res) => { - let locationsLookup = {}; - let resourceLocations = res.result.value; - let i; - for (i = 0; i < resourceLocations.length; i++) { - let resourceLocation = resourceLocations[i]; - locationsLookup[resourceLocation.id.toLowerCase()] = resourceLocation; + /** + * Get history of a test method using TestHistoryQuery + * + * @param {TestInterfaces.TestHistoryQuery} filter - TestHistoryQuery to get history + * @param {string} project - Project ID or project name + */ + queryTestHistory(filter, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "Test", "929fd86c-3e38-4d8c-b4b6-90df256e5971", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, filter, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestHistoryQuery, false); + resolve(ret); } - // If we have completed successfully, cache the response. - this._locationsByAreaPromises[area] = areaLocationsPromise; - return locationsLookup; - }); - } - return areaLocationsPromise; - } - resolveUrl(relativeUrl) { - return url.resolve(this.baseUrl, path.join(this.basePath, relativeUrl)); + catch (err) { + reject(err); + } + })); + }); } - queryParamsToStringHelper(queryParams, prefix) { - if (!queryParams) { - return ''; - } - let queryString = ''; - if (typeof (queryParams) !== 'string') { - for (let property in queryParams) { - if (queryParams.hasOwnProperty(property)) { - const prop = queryParams[property]; - const newPrefix = prefix + encodeURIComponent(property.toString()) + '.'; - queryString += this.queryParamsToStringHelper(prop, newPrefix); + /** + * @param {TestInterfaces.TestSettings} testSettings + * @param {string} project - Project ID or project name + */ + createTestSettings(testSettings, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "8133ce14-962f-42af-a5f9-6aa9defcb9c8", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, testSettings, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); } - } - } - if (queryString === '' && prefix.length > 0) { - // Date.prototype.toString() returns a string that is not valid for the REST API. - // Need to specially call `toUTCString()` instead for such cases - const queryValue = typeof queryParams === 'object' && 'toUTCString' in queryParams ? queryParams.toUTCString() : queryParams.toString(); - // Will always need to chop period off of end of prefix - queryString = prefix.slice(0, -1) + '=' + encodeURIComponent(queryValue) + '&'; - } - return queryString; + catch (err) { + reject(err); + } + })); + }); } - queryParamsToString(queryParams) { - const queryString = '?' + this.queryParamsToStringHelper(queryParams, ''); - // Will always need to slice either a ? or & off of the end - return queryString.slice(0, -1); + /** + * @param {string} project - Project ID or project name + * @param {number} testSettingsId + */ + deleteTestSettings(project, testSettingsId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + testSettingsId: testSettingsId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "8133ce14-962f-42af-a5f9-6aa9defcb9c8", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); } - getRequestUrl(routeTemplate, area, resource, routeValues, queryParams) { - // Add area/resource route values (based on the location) - routeValues = routeValues || {}; - if (!routeValues.area) { - routeValues.area = area; - } - if (!routeValues.resource) { - routeValues.resource = resource; - } - // Replace templated route values - let relativeUrl = this.replaceRouteValues(routeTemplate, routeValues); - // Append query parameters to the end - if (queryParams) { - relativeUrl += this.queryParamsToString(queryParams); - } - // Resolve the relative url with the base - return url.resolve(this.baseUrl, path.join(this.basePath, relativeUrl)); + /** + * @param {string} project - Project ID or project name + * @param {number} testSettingsId + */ + getTestSettingsById(project, testSettingsId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + testSettingsId: testSettingsId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "8133ce14-962f-42af-a5f9-6aa9defcb9c8", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); } - // helper method copied directly from VSS\WebAPI\restclient.ts - replaceRouteValues(routeTemplate, routeValues) { - let result = "", currentPathPart = "", paramName = "", insideParam = false, charIndex, routeTemplateLength = routeTemplate.length, c; - for (charIndex = 0; charIndex < routeTemplateLength; charIndex++) { - c = routeTemplate[charIndex]; - if (insideParam) { - if (c == "}") { - insideParam = false; - if (routeValues[paramName]) { - currentPathPart += encodeURIComponent(routeValues[paramName]); - } - else { - // Normalize param name in order to capture wild-card routes - let strippedParamName = paramName.replace(/[^a-z0-9]/ig, ''); - if (routeValues[strippedParamName]) { - currentPathPart += encodeURIComponent(routeValues[strippedParamName]); - } - } - paramName = ""; + /** + * @param {TestInterfaces.WorkItemToTestLinks} workItemToTestLinks + * @param {string} project - Project ID or project name + */ + addWorkItemToTestLinks(workItemToTestLinks, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "371b1655-ce05-412e-a113-64cc77bb78d2", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, workItemToTestLinks, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.WorkItemToTestLinks, false); + resolve(ret); } - else { - paramName += c; + catch (err) { + reject(err); } + })); + }); + } + /** + * @param {string} project - Project ID or project name + * @param {string} testName + * @param {number} workItemId + */ + deleteTestMethodToWorkItemLink(project, testName, workItemId) { + return __awaiter(this, void 0, void 0, function* () { + if (testName == null) { + throw new TypeError('testName can not be null or undefined'); } - else { - if (c == "/") { - if (currentPathPart) { - if (result) { - result += "/"; - } - result += currentPathPart; - currentPathPart = ""; - } + if (workItemId == null) { + throw new TypeError('workItemId can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + testName: testName, + workItemId: workItemId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "7b0bdee3-a354-47f9-a42c-89018d7808d5", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); } - else if (c == "{") { - if ((charIndex + 1) < routeTemplateLength && routeTemplate[charIndex + 1] == "{") { - // Escaped '{' - currentPathPart += c; - charIndex++; - } - else { - insideParam = true; - } + catch (err) { + reject(err); } - else if (c == '}') { - currentPathPart += c; - if ((charIndex + 1) < routeTemplateLength && routeTemplate[charIndex + 1] == "}") { - // Escaped '}' - charIndex++; - } + })); + }); + } + /** + * @param {string} project - Project ID or project name + * @param {string} testName + */ + queryTestMethodLinkedWorkItems(project, testName) { + return __awaiter(this, void 0, void 0, function* () { + if (testName == null) { + throw new TypeError('testName can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + testName: testName, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "7b0bdee3-a354-47f9-a42c-89018d7808d5", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, TestInterfaces.TypeInfo.TestToWorkItemLinks, false); + resolve(ret); } - else { - currentPathPart += c; + catch (err) { + reject(err); } - } - } - if (currentPathPart) { - if (result) { - result += "/"; - } - result += currentPathPart; - } - return result; - } -} -VsoClient.APIS_RELATIVE_PATH = "_apis"; -VsoClient.PREVIEW_INDICATOR = "-preview."; -exports.VsoClient = VsoClient; - - -/***/ }), - -/***/ 7967: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const buildm = __nccwpck_require__(9893); -const corem = __nccwpck_require__(4020); -const dashboardm = __nccwpck_require__(7539); -const extmgmtm = __nccwpck_require__(4605); -const featuremgmtm = __nccwpck_require__(3193); -const filecontainerm = __nccwpck_require__(7558); -const gallerym = __nccwpck_require__(1939); -const gitm = __nccwpck_require__(4996); -const locationsm = __nccwpck_require__(4771); -const notificationm = __nccwpck_require__(8221); -const policym = __nccwpck_require__(266); -const profilem = __nccwpck_require__(8101); -const projectm = __nccwpck_require__(1682); -const releasem = __nccwpck_require__(3075); -const securityrolesm = __nccwpck_require__(806); -const taskagentm = __nccwpck_require__(5899); -const taskm = __nccwpck_require__(2354); -const testm = __nccwpck_require__(5742); -const tfvcm = __nccwpck_require__(5417); -const wikim = __nccwpck_require__(6391); -const workm = __nccwpck_require__(8186); -const workitemtrackingm = __nccwpck_require__(8409); -const workitemtrackingprocessm = __nccwpck_require__(1178); -const workitemtrackingprocessdefinitionm = __nccwpck_require__(3333); -const basicm = __nccwpck_require__(6456); -const bearm = __nccwpck_require__(1141); -const ntlmm = __nccwpck_require__(3450); -const patm = __nccwpck_require__(4551); -const rm = __nccwpck_require__(7405); -const vsom = __nccwpck_require__(9686); -const crypto = __nccwpck_require__(6113); -const fs = __nccwpck_require__(7147); -const os = __nccwpck_require__(2037); -const url = __nccwpck_require__(7310); -const path = __nccwpck_require__(1017); -const isBrowser = typeof window !== 'undefined'; -/** - * Methods to return handler objects (see handlers folder) - */ -function getBasicHandler(username, password, allowCrossOriginAuthentication) { - return new basicm.BasicCredentialHandler(username, password, allowCrossOriginAuthentication); -} -exports.getBasicHandler = getBasicHandler; -function getNtlmHandler(username, password, workstation, domain) { - return new ntlmm.NtlmCredentialHandler(username, password, workstation, domain); -} -exports.getNtlmHandler = getNtlmHandler; -function getBearerHandler(token, allowCrossOriginAuthentication) { - return new bearm.BearerCredentialHandler(token, allowCrossOriginAuthentication); -} -exports.getBearerHandler = getBearerHandler; -function getPersonalAccessTokenHandler(token, allowCrossOriginAuthentication) { - return new patm.PersonalAccessTokenCredentialHandler(token, allowCrossOriginAuthentication); -} -exports.getPersonalAccessTokenHandler = getPersonalAccessTokenHandler; -function getHandlerFromToken(token, allowCrossOriginAuthentication) { - if (token.length === 52) { - return getPersonalAccessTokenHandler(token, allowCrossOriginAuthentication); - } - else { - return getBearerHandler(token, allowCrossOriginAuthentication); - } -} -exports.getHandlerFromToken = getHandlerFromToken; -; -// --------------------------------------------------------------------------- -// Factory to return client apis -// When new APIs are added, a method must be added here to instantiate the API -//---------------------------------------------------------------------------- -class WebApi { - /* - * Factory to return client apis and handlers - * @param defaultUrl default server url to use when creating new apis from factory methods - * @param authHandler default authentication credentials to use when creating new apis from factory methods - */ - constructor(defaultUrl, authHandler, options, requestSettings) { - /** - * Determines if the domain is exluded for proxy via the no_proxy env var - * @param url: the server url - */ - this.isNoProxyHost = function (_url) { - if (!process.env.no_proxy) { - return false; - } - const noProxyDomains = (process.env.no_proxy || '') - .split(',') - .map(v => v.toLowerCase()); - const serverUrl = url.parse(_url).host.toLowerCase(); - // return true if the no_proxy includes the host - return noProxyDomains.indexOf(serverUrl) !== -1; - }; - this.serverUrl = defaultUrl; - this.authHandler = authHandler; - this.options = options || {}; - if (!this.isNoProxyHost(this.serverUrl)) { - // try to get proxy setting from environment variable set by VSTS-Task-Lib if there is no proxy setting in the options - if (!this.options.proxy || !this.options.proxy.proxyUrl) { - if (global['_vsts_task_lib_proxy']) { - let proxyFromEnv = { - proxyUrl: global['_vsts_task_lib_proxy_url'], - proxyUsername: global['_vsts_task_lib_proxy_username'], - proxyPassword: this._readTaskLibSecrets(global['_vsts_task_lib_proxy_password']), - proxyBypassHosts: JSON.parse(global['_vsts_task_lib_proxy_bypass'] || "[]"), - }; - this.options.proxy = proxyFromEnv; - } - } - } - // try get cert setting from environment variable set by VSTS-Task-Lib if there is no cert setting in the options - if (!this.options.cert) { - if (global['_vsts_task_lib_cert']) { - let certFromEnv = { - caFile: global['_vsts_task_lib_cert_ca'], - certFile: global['_vsts_task_lib_cert_clientcert'], - keyFile: global['_vsts_task_lib_cert_key'], - passphrase: this._readTaskLibSecrets(global['_vsts_task_lib_cert_passphrase']), - }; - this.options.cert = certFromEnv; - } - } - // try get ignore SSL error setting from environment variable set by VSTS-Task-Lib if there is no ignore SSL error setting in the options - if (!this.options.ignoreSslError) { - this.options.ignoreSslError = !!global['_vsts_task_lib_skip_cert_validation']; - } - let userAgent; - const nodeApiName = 'azure-devops-node-api'; - if (isBrowser) { - if (requestSettings) { - userAgent = `${requestSettings.productName}/${requestSettings.productVersion} (${nodeApiName}; ${window.navigator.userAgent})`; - } - else { - userAgent = `${nodeApiName} (${window.navigator.userAgent})`; - } - } - else { - let nodeApiVersion = 'unknown'; - const packageJsonPath = __nccwpck_require__.ab + "package.json"; - if (fs.existsSync(__nccwpck_require__.ab + "package.json")) { - nodeApiVersion = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')).version; - } - const osName = os.platform(); - const osVersion = os.release(); - if (requestSettings) { - userAgent = `${requestSettings.productName}/${requestSettings.productVersion} (${nodeApiName} ${nodeApiVersion}; ${osName} ${osVersion})`; - } - else { - userAgent = `${nodeApiName}/${nodeApiVersion} (${osName} ${osVersion})`; - } - } - this.rest = new rm.RestClient(userAgent, null, [this.authHandler], this.options); - this.vsoClient = new vsom.VsoClient(defaultUrl, this.rest); + })); + }); } /** - * Convenience factory to create with a bearer token. - * @param defaultServerUrl default server url to use when creating new apis from factory methods - * @param defaultAuthHandler default authentication credentials to use when creating new apis from factory methods + * @param {string} project - Project ID or project name + * @param {string} workItemCategory + * @param {string} automatedTestName + * @param {number} testCaseId + * @param {Date} maxCompleteDate + * @param {number} days + * @param {number} workItemCount */ - static createWithBearerToken(defaultUrl, token, options) { - let bearerHandler = getBearerHandler(token); - return new this(defaultUrl, bearerHandler, options); - } - connect() { + queryTestResultWorkItems(project, workItemCategory, automatedTestName, testCaseId, maxCompleteDate, days, workItemCount) { return __awaiter(this, void 0, void 0, function* () { + if (workItemCategory == null) { + throw new TypeError('workItemCategory can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + workItemCategory: workItemCategory, + automatedTestName: automatedTestName, + testCaseId: testCaseId, + maxCompleteDate: maxCompleteDate, + days: days, + '$workItemCount': workItemCount, + }; try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Test", "926ff5dc-137f-45f0-bd51-9412fa9810ce", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(this.vsoClient.resolveUrl('/_apis/connectionData')); - resolve(res.result); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); } catch (err) { reject(err); @@ -30251,261 +31943,14 @@ class WebApi { })); }); } - /** - * Each factory method can take a serverUrl and a list of handlers - * if these aren't provided, the default url and auth handler given to the constructor for this class will be used - */ - getBuildApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, buildm.BuildApi.RESOURCE_AREA_ID); - handlers = handlers || [this.authHandler]; - return new buildm.BuildApi(serverUrl, handlers, this.options); - }); - } - getCoreApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "79134c72-4a58-4b42-976c-04e7115f32bf"); - handlers = handlers || [this.authHandler]; - return new corem.CoreApi(serverUrl, handlers, this.options); - }); - } - getDashboardApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "31c84e0a-3ece-48fd-a29d-100849af99ba"); - handlers = handlers || [this.authHandler]; - return new dashboardm.DashboardApi(serverUrl, handlers, this.options); - }); - } - getExtensionManagementApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "6c2b0933-3600-42ae-bf8b-93d4f7e83594"); - handlers = handlers || [this.authHandler]; - return new extmgmtm.ExtensionManagementApi(serverUrl, handlers, this.options); - }); - } - getFeatureManagementApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, ""); - handlers = handlers || [this.authHandler]; - return new featuremgmtm.FeatureManagementApi(serverUrl, handlers, this.options); - }); - } - getFileContainerApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, ""); - handlers = handlers || [this.authHandler]; - return new filecontainerm.FileContainerApi(serverUrl, handlers, this.options); - }); - } - getGalleryApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, gallerym.GalleryApi.RESOURCE_AREA_ID); - handlers = handlers || [this.authHandler]; - return new gallerym.GalleryApi(serverUrl, handlers, this.options); - }); - } - getGitApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, gitm.GitApi.RESOURCE_AREA_ID); - handlers = handlers || [this.authHandler]; - return new gitm.GitApi(serverUrl, handlers, this.options); - }); - } - // TODO: Don't call resource area here? Will cause infinite loop? - getLocationsApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - let optionsClone = Object.assign({}, this.options); - optionsClone.allowRetries = true; - optionsClone.maxRetries = 5; - serverUrl = (yield serverUrl) || this.serverUrl; - handlers = handlers || [this.authHandler]; - return new locationsm.LocationsApi(serverUrl, handlers, optionsClone); - }); - } - getNotificationApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, ""); - handlers = handlers || [this.authHandler]; - return new notificationm.NotificationApi(serverUrl, handlers, this.options); - }); - } - getPolicyApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "fb13a388-40dd-4a04-b530-013a739c72ef"); - handlers = handlers || [this.authHandler]; - return new policym.PolicyApi(serverUrl, handlers, this.options); - }); - } - getProfileApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "8ccfef3d-2b87-4e99-8ccb-66e343d2daa8"); - handlers = handlers || [this.authHandler]; - return new profilem.ProfileApi(serverUrl, handlers, this.options); - }); - } - getProjectAnalysisApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "7658fa33-b1bf-4580-990f-fac5896773d3"); - handlers = handlers || [this.authHandler]; - return new projectm.ProjectAnalysisApi(serverUrl, handlers, this.options); - }); - } - getSecurityRolesApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, ""); - handlers = handlers || [this.authHandler]; - return new securityrolesm.SecurityRolesApi(serverUrl, handlers, this.options); - }); - } - getReleaseApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "efc2f575-36ef-48e9-b672-0c6fb4a48ac5"); - handlers = handlers || [this.authHandler]; - return new releasem.ReleaseApi(serverUrl, handlers, this.options); - }); - } - getTaskApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, ""); - handlers = handlers || [this.authHandler]; - return new taskm.TaskApi(serverUrl, handlers, this.options); - }); - } - getTaskAgentApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "a85b8835-c1a1-4aac-ae97-1c3d0ba72dbd"); - handlers = handlers || [this.authHandler]; - return new taskagentm.TaskAgentApi(serverUrl, handlers, this.options); - }); - } - getTestApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "c2aa639c-3ccc-4740-b3b6-ce2a1e1d984e"); - handlers = handlers || [this.authHandler]; - return new testm.TestApi(serverUrl, handlers, this.options); - }); - } - getTfvcApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "8aa40520-446d-40e6-89f6-9c9f9ce44c48"); - handlers = handlers || [this.authHandler]; - return new tfvcm.TfvcApi(serverUrl, handlers, this.options); - }); - } - getWikiApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "bf7d82a0-8aa5-4613-94ef-6172a5ea01f3"); - handlers = handlers || [this.authHandler]; - return new wikim.WikiApi(serverUrl, handlers, this.options); - }); - } - getWorkApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "1d4f49f9-02b9-4e26-b826-2cdb6195f2a9"); - handlers = handlers || [this.authHandler]; - return new workm.WorkApi(serverUrl, handlers, this.options); - }); - } - getWorkItemTrackingApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, workitemtrackingm.WorkItemTrackingApi.RESOURCE_AREA_ID); - handlers = handlers || [this.authHandler]; - return new workitemtrackingm.WorkItemTrackingApi(serverUrl, handlers, this.options); - }); - } - getWorkItemTrackingProcessApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "5264459e-e5e0-4bd8-b118-0985e68a4ec5"); - handlers = handlers || [this.authHandler]; - return new workitemtrackingprocessm.WorkItemTrackingProcessApi(serverUrl, handlers, this.options); - }); - } - getWorkItemTrackingProcessDefinitionApi(serverUrl, handlers) { - return __awaiter(this, void 0, void 0, function* () { - // TODO: Load RESOURCE_AREA_ID correctly. - serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "5264459e-e5e0-4bd8-b118-0985e68a4ec5"); - handlers = handlers || [this.authHandler]; - return new workitemtrackingprocessdefinitionm.WorkItemTrackingProcessDefinitionsApi(serverUrl, handlers, this.options); - }); - } - _getResourceAreaUrl(serverUrl, resourceId) { - return __awaiter(this, void 0, void 0, function* () { - if (!resourceId) { - return serverUrl; - } - // This must be of type any, see comment just below. - const resourceAreas = yield this._getResourceAreas(); - if (resourceAreas === undefined) { - throw new Error((`Failed to retrieve resource areas ' + 'from server: ${serverUrl}`)); - } - // The response type differs based on whether or not there are resource areas. When we are on prem we get: - // {"count":0,"value":null} and when we are on VSTS we get an array of resource areas. - // Due to this strangeness the type of resourceAreas needs to be any and we need to check .count - // When going against vsts count will be undefined. On prem it will be 0 - if (!resourceAreas || resourceAreas.length === 0 || resourceAreas.count === 0) { - // For on prem environments we get an empty list - return serverUrl; - } - for (var resourceArea of resourceAreas) { - if (resourceArea.id.toLowerCase() === resourceId.toLowerCase()) { - return resourceArea.locationUrl; - } - } - throw new Error((`Could not find information for resource area ${resourceId} ' + 'from server: ${serverUrl}`)); - }); - } - _getResourceAreas() { - return __awaiter(this, void 0, void 0, function* () { - if (!this._resourceAreas) { - const locationClient = yield this.getLocationsApi(); - this._resourceAreas = yield locationClient.getResourceAreas(); - } - return this._resourceAreas; - }); - } - _readTaskLibSecrets(lookupKey) { - if (isBrowser) { - throw new Error("Browsers can't securely keep secrets"); - } - // the lookupKey should has following format - // base64encoded:base64encoded - if (lookupKey && lookupKey.indexOf(':') > 0) { - let lookupInfo = lookupKey.split(':', 2); - // file contains encryption key - let keyFile = new Buffer(lookupInfo[0], 'base64').toString('utf8'); - let encryptKey = new Buffer(fs.readFileSync(keyFile, 'utf8'), 'base64'); - let encryptedContent = new Buffer(lookupInfo[1], 'base64').toString('utf8'); - let decipher = crypto.createDecipher("aes-256-ctr", encryptKey); - let decryptedContent = decipher.update(encryptedContent, 'hex', 'utf8'); - decryptedContent += decipher.final('utf8'); - return decryptedContent; - } - } } -exports.WebApi = WebApi; +exports.TestApi = TestApi; +TestApi.RESOURCE_AREA_ID = "c2aa639c-3ccc-4740-b3b6-ce2a1e1d984e"; /***/ }), -/***/ 6391: +/***/ 8737: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -30520,47 +31965,41 @@ exports.WebApi = WebApi; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TestPlanApi = void 0; const basem = __nccwpck_require__(273); -const Comments_Contracts = __nccwpck_require__(4743); -const WikiInterfaces = __nccwpck_require__(5787); -class WikiApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Wiki-api', options); +const TestPlanInterfaces = __nccwpck_require__(8969); +class TestPlanApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-TestPlan-api', options); } /** - * Uploads an attachment on a comment on a wiki page. + * Create a test configuration. * - * @param {NodeJS.ReadableStream} contentStream - Content to upload + * @param {TestPlanInterfaces.TestConfigurationCreateUpdateParameters} testConfigurationCreateUpdateParameters - TestConfigurationCreateUpdateParameters * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {number} pageId - Wiki page ID. */ - createCommentAttachment(customHeaders, contentStream, project, wikiIdentifier, pageId) { + createTestConfiguration(testConfigurationCreateUpdateParameters, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId + project: project }; - customHeaders = customHeaders || {}; - customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "5100d976-363d-42e7-a19d-4171ecb44782", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "8369318e-38fa-4e84-9043-4b2a75d2c256", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); - options.additionalHeaders = customHeaders; let res; - res = yield this.rest.uploadStream("POST", url, contentStream, options); - let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.CommentAttachment, false); + res = yield this.rest.create(url, testConfigurationCreateUpdateParameters, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestConfiguration, false); resolve(ret); } catch (err) { @@ -30570,28 +32009,31 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Downloads an attachment on a comment on a wiki page. + * Delete a test configuration by its ID. * * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {number} pageId - Wiki page ID. - * @param {string} attachmentId - Attachment ID. + * @param {number} testConfiguartionId - ID of the test configuration to delete. */ - getAttachmentContent(project, wikiIdentifier, pageId, attachmentId) { + deleteTestConfguration(project, testConfiguartionId) { return __awaiter(this, void 0, void 0, function* () { + if (testConfiguartionId == null) { + throw new TypeError('testConfiguartionId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId, - attachmentId: attachmentId + project: project + }; + let queryValues = { + testConfiguartionId: testConfiguartionId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "5100d976-363d-42e7-a19d-4171ecb44782", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "8369318e-38fa-4e84-9043-4b2a75d2c256", routeValues, queryValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); } catch (err) { reject(err); @@ -30600,31 +32042,25 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Add a reaction on a wiki page comment. + * Get a test configuration * * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name - * @param {number} pageId - Wiki page ID - * @param {number} commentId - ID of the associated comment - * @param {Comments_Contracts.CommentReactionType} type - Type of the reaction being added + * @param {number} testConfigurationId - ID of the test configuration to get. */ - addCommentReaction(project, wikiIdentifier, pageId, commentId, type) { + getTestConfigurationById(project, testConfigurationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId, - commentId: commentId, - type: type + testConfigurationId: testConfigurationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "7a5bc693-aab7-4d48-8f34-36f373022063", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "8369318e-38fa-4e84-9043-4b2a75d2c256", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, null, options); - let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.CommentReaction, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestConfiguration, false); resolve(ret); } catch (err) { @@ -30634,31 +32070,27 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Delete a reaction on a wiki page comment. + * Get a list of test configurations. * * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or name - * @param {number} pageId - Wiki page ID - * @param {number} commentId - ID of the associated comment - * @param {Comments_Contracts.CommentReactionType} type - Type of the reaction being deleted + * @param {string} continuationToken - If the list of configurations returned is not complete, a continuation token to query next batch of configurations is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test configurations. */ - deleteCommentReaction(project, wikiIdentifier, pageId, commentId, type) { + getTestConfigurations(project, continuationToken) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId, - commentId: commentId, - type: type + project: project + }; + let queryValues = { + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "7a5bc693-aab7-4d48-8f34-36f373022063", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "8369318e-38fa-4e84-9043-4b2a75d2c256", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.CommentReaction, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestConfiguration, true); resolve(ret); } catch (err) { @@ -30668,32 +32100,66 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Gets a list of users who have reacted for the given wiki comment with a given reaction type. Supports paging, with a default page size of 100 users at a time. + * Update a test configuration by its ID. * + * @param {TestPlanInterfaces.TestConfigurationCreateUpdateParameters} testConfigurationCreateUpdateParameters - TestConfigurationCreateUpdateParameters * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {number} pageId - Wiki page ID. - * @param {number} commentId - ID of the associated comment - * @param {Comments_Contracts.CommentReactionType} type - Type of the reaction for which the engaged users are being requested - * @param {number} top - Number of enagaged users to be returned in a given page. Optional, defaults to 100 - * @param {number} skip - Number of engaged users to be skipped to page the next set of engaged users, defaults to 0 + * @param {number} testConfiguartionId - ID of the test configuration to update. */ - getEngagedUsers(project, wikiIdentifier, pageId, commentId, type, top, skip) { + updateTestConfiguration(testConfigurationCreateUpdateParameters, project, testConfiguartionId) { + return __awaiter(this, void 0, void 0, function* () { + if (testConfiguartionId == null) { + throw new TypeError('testConfiguartionId can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + testConfiguartionId: testConfiguartionId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "8369318e-38fa-4e84-9043-4b2a75d2c256", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, testConfigurationCreateUpdateParameters, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestConfiguration, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {string} states + * @param {TestPlanInterfaces.UserFriendlyTestOutcome} outcome + * @param {string} configurations + * @param {string} testers + * @param {string} assignedTo + * @param {TestPlanInterfaces.TestEntityTypes} entity + */ + getTestEntityCountByPlanId(project, planId, states, outcome, configurations, testers, assignedTo, entity) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId, - commentId: commentId, - type: type + planId: planId }; let queryValues = { - '$top': top, - '$skip': skip, + states: states, + outcome: outcome, + configurations: configurations, + testers: testers, + assignedTo: assignedTo, + entity: entity, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "598a5268-41a7-4162-b7dc-344131e4d1fa", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "300578da-7b40-4c1e-9542-7aed6029e504", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -30708,28 +32174,24 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Add a comment on a wiki page. + * Create a test plan. * - * @param {Comments_Contracts.CommentCreateParameters} request - Comment create request. + * @param {TestPlanInterfaces.TestPlanCreateParams} testPlanCreateParams - A testPlanCreateParams object.TestPlanCreateParams * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {number} pageId - Wiki page ID. */ - addComment(request, project, wikiIdentifier, pageId) { + createTestPlan(testPlanCreateParams, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "9b394e93-7db5-46cb-9c26-09a36aa5c895", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "0e292477-a0c2-47f3-a9b6-34f153d627f4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, request, options); - let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.Comment, false); + res = yield this.rest.create(url, testPlanCreateParams, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPlan, false); resolve(ret); } catch (err) { @@ -30739,24 +32201,20 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Delete a comment on a wiki page. + * Delete a test plan. * * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or name. - * @param {number} pageId - Wiki page ID. - * @param {number} id - Comment ID. + * @param {number} planId - ID of the test plan to be deleted. */ - deleteComment(project, wikiIdentifier, pageId, id) { + deleteTestPlan(project, planId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId, - id: id + planId: planId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "9b394e93-7db5-46cb-9c26-09a36aa5c895", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "0e292477-a0c2-47f3-a9b6-34f153d627f4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -30771,35 +32229,25 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Returns a comment associated with the Wiki Page. + * Get a test plan by Id. * * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {number} pageId - Wiki page ID. - * @param {number} id - ID of the comment to return. - * @param {boolean} excludeDeleted - Specify if the deleted comment should be skipped. - * @param {Comments_Contracts.CommentExpandOptions} expand - Specifies the additional data retrieval options for comments. + * @param {number} planId - ID of the test plan to get. */ - getComment(project, wikiIdentifier, pageId, id, excludeDeleted, expand) { + getTestPlanById(project, planId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId, - id: id - }; - let queryValues = { - excludeDeleted: excludeDeleted, - '$expand': expand, + planId: planId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "9b394e93-7db5-46cb-9c26-09a36aa5c895", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "0e292477-a0c2-47f3-a9b6-34f153d627f4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.Comment, false); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPlan, false); resolve(ret); } catch (err) { @@ -30809,41 +32257,33 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Returns a pageable list of comments. + * Get a list of test plans * * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {number} pageId - Wiki page ID. - * @param {number} top - Max number of comments to return. - * @param {string} continuationToken - Used to query for the next page of comments. - * @param {boolean} excludeDeleted - Specify if the deleted comments should be skipped. - * @param {Comments_Contracts.CommentExpandOptions} expand - Specifies the additional data retrieval options for comments. - * @param {Comments_Contracts.CommentSortOrder} order - Order in which the comments should be returned. - * @param {number} parentId - CommentId of the parent comment. + * @param {string} owner - Filter for test plan by owner ID or name + * @param {string} continuationToken - If the list of plans returned is not complete, a continuation token to query next batch of plans is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test plans. + * @param {boolean} includePlanDetails - Get all properties of the test plan + * @param {boolean} filterActivePlans - Get just the active plans */ - listComments(project, wikiIdentifier, pageId, top, continuationToken, excludeDeleted, expand, order, parentId) { + getTestPlans(project, owner, continuationToken, includePlanDetails, filterActivePlans) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId + project: project }; let queryValues = { - '$top': top, + owner: owner, continuationToken: continuationToken, - excludeDeleted: excludeDeleted, - '$expand': expand, - order: order, - parentId: parentId, + includePlanDetails: includePlanDetails, + filterActivePlans: filterActivePlans, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "9b394e93-7db5-46cb-9c26-09a36aa5c895", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "0e292477-a0c2-47f3-a9b6-34f153d627f4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.CommentList, false); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPlan, true); resolve(ret); } catch (err) { @@ -30853,30 +32293,26 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Update a comment on a wiki page. + * Update a test plan. * - * @param {Comments_Contracts.CommentUpdateParameters} comment - Comment update request. + * @param {TestPlanInterfaces.TestPlanUpdateParams} testPlanUpdateParams - A testPlanUpdateParams object.TestPlanUpdateParams * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {number} pageId - Wiki page ID. - * @param {number} id - Comment ID. + * @param {number} planId - ID of the test plan to be updated. */ - updateComment(comment, project, wikiIdentifier, pageId, id) { + updateTestPlan(testPlanUpdateParams, project, planId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId, - id: id + planId: planId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "9b394e93-7db5-46cb-9c26-09a36aa5c895", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "0e292477-a0c2-47f3-a9b6-34f153d627f4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, comment, options); - let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.Comment, false); + res = yield this.rest.update(url, testPlanUpdateParams, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPlan, false); resolve(ret); } catch (err) { @@ -30886,34 +32322,30 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. + * Get a list of test suite entries in the test suite. * * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {string} path - Wiki page path. - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional). - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - GitVersionDescriptor for the page. Defaults to the default branch (Optional). - * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional) + * @param {number} suiteId - Id of the parent suite. + * @param {TestPlanInterfaces.SuiteEntryTypes} suiteEntryType */ - getPageText(project, wikiIdentifier, path, recursionLevel, versionDescriptor, includeContent) { + getSuiteEntries(project, suiteId, suiteEntryType) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier + suiteId: suiteId }; let queryValues = { - path: path, - recursionLevel: recursionLevel, - versionDescriptor: versionDescriptor, - includeContent: includeContent, + suiteEntryType: suiteEntryType, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "d6733edf-72f1-4252-925b-c560dfe9b75a", routeValues, queryValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.SuiteEntry, true); + resolve(ret); } catch (err) { reject(err); @@ -30922,34 +32354,27 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. + * Reorder test suite entries in the test suite. * + * @param {TestPlanInterfaces.SuiteEntryUpdateParams[]} suiteEntries - List of SuiteEntry to reorder. * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {string} path - Wiki page path. - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional). - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - GitVersionDescriptor for the page. Defaults to the default branch (Optional). - * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional) + * @param {number} suiteId - Id of the parent test suite. */ - getPageZip(project, wikiIdentifier, path, recursionLevel, versionDescriptor, includeContent) { + reorderSuiteEntries(suiteEntries, project, suiteId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier - }; - let queryValues = { - path: path, - recursionLevel: recursionLevel, - versionDescriptor: versionDescriptor, - includeContent: includeContent, + suiteId: suiteId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "d6733edf-72f1-4252-925b-c560dfe9b75a", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, suiteEntries, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.SuiteEntry, true); + resolve(ret); } catch (err) { reject(err); @@ -30958,32 +32383,29 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Gets metadata or content of the wiki page for the provided page id. Content negotiation is done based on the `Accept` header sent in the request. + * Create bulk requirement based test suites. * + * @param {TestPlanInterfaces.TestSuiteCreateParams[]} testSuiteCreateParams - Parameters for suite creation * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name.. - * @param {number} id - Wiki page ID. - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional). - * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional) + * @param {number} planId - ID of the test plan where requirement based suites need to be created. + * @param {number} parentSuiteId - ID of the parent suite under which requirement based suites will be created */ - getPageByIdText(project, wikiIdentifier, id, recursionLevel, includeContent) { + createBulkTestSuites(testSuiteCreateParams, project, planId, parentSuiteId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier, - id: id - }; - let queryValues = { - recursionLevel: recursionLevel, - includeContent: includeContent, + planId: planId, + parentSuiteId: parentSuiteId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "ceddcf75-1068-452d-8b13-2d4d76e1f970", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1e58fbe6-1761-43ce-97f6-5492ec9d438e", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("text/plain", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, testSuiteCreateParams, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, true); + resolve(ret); } catch (err) { reject(err); @@ -30992,32 +32414,27 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Gets metadata or content of the wiki page for the provided page id. Content negotiation is done based on the `Accept` header sent in the request. + * Create test suite. * + * @param {TestPlanInterfaces.TestSuiteCreateParams} testSuiteCreateParams - Parameters for suite creation * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name.. - * @param {number} id - Wiki page ID. - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional). - * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional) + * @param {number} planId - ID of the test plan that contains the suites. */ - getPageByIdZip(project, wikiIdentifier, id, recursionLevel, includeContent) { + createTestSuite(testSuiteCreateParams, project, planId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier, - id: id - }; - let queryValues = { - recursionLevel: recursionLevel, - includeContent: includeContent, + planId: planId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "ceddcf75-1068-452d-8b13-2d4d76e1f970", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1046d5d3-ab61-4ca7-a65a-36118a978256", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, testSuiteCreateParams, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, false); + resolve(ret); } catch (err) { reject(err); @@ -31026,30 +32443,27 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Returns pageable list of Wiki Pages + * Delete test suite. * - * @param {WikiInterfaces.WikiPagesBatchRequest} pagesBatchRequest - Wiki batch page request. * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - GitVersionDescriptor for the page. (Optional in case of ProjectWiki). + * @param {number} planId - ID of the test plan that contains the suite. + * @param {number} suiteId - ID of the test suite to delete. */ - getPagesBatch(pagesBatchRequest, project, wikiIdentifier, versionDescriptor) { + deleteTestSuite(project, planId, suiteId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier - }; - let queryValues = { - versionDescriptor: versionDescriptor, + planId: planId, + suiteId: suiteId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "71323c46-2592-4398-8771-ced73dd87207", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1046d5d3-ab61-4ca7-a65a-36118a978256", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, pagesBatchRequest, options); - let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiPageDetail, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -31059,31 +32473,31 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Returns page detail corresponding to Page ID. + * Get test suite by suite id. * * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {number} pageId - Wiki page ID. - * @param {number} pageViewsForDays - last N days from the current day for which page views is to be returned. It's inclusive of current day. + * @param {number} planId - ID of the test plan that contains the suites. + * @param {number} suiteId - ID of the suite to get. + * @param {TestPlanInterfaces.SuiteExpand} expand - Include the children suites and testers details */ - getPageData(project, wikiIdentifier, pageId, pageViewsForDays) { + getTestSuiteById(project, planId, suiteId, expand) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier, - pageId: pageId + planId: planId, + suiteId: suiteId }; let queryValues = { - pageViewsForDays: pageViewsForDays, + expand: expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "81c4e0fe-7663-4d62-ad46-6ab78459f274", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1046d5d3-ab61-4ca7-a65a-36118a978256", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiPageDetail, false); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, false); resolve(ret); } catch (err) { @@ -31093,39 +32507,33 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Creates a new page view stats resource or updates an existing page view stats resource. + * Get test suites for plan. * * @param {string} project - Project ID or project name - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {GitInterfaces.GitVersionDescriptor} wikiVersion - Wiki version. - * @param {string} path - Wiki page path. - * @param {string} oldPath - Old page path. This is optional and required to rename path in existing page view stats. + * @param {number} planId - ID of the test plan for which suites are requested. + * @param {TestPlanInterfaces.SuiteExpand} expand - Include the children suites and testers details. + * @param {string} continuationToken - If the list of suites returned is not complete, a continuation token to query next batch of suites is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test suites. + * @param {boolean} asTreeView - If the suites returned should be in a tree structure. */ - createOrUpdatePageViewStats(project, wikiIdentifier, wikiVersion, path, oldPath) { + getTestSuitesForPlan(project, planId, expand, continuationToken, asTreeView) { return __awaiter(this, void 0, void 0, function* () { - if (wikiVersion == null) { - throw new TypeError('wikiVersion can not be null or undefined'); - } - if (path == null) { - throw new TypeError('path can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier + planId: planId }; let queryValues = { - wikiVersion: wikiVersion, - path: path, - oldPath: oldPath, + expand: expand, + continuationToken: continuationToken, + asTreeView: asTreeView, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wiki", "1087b746-5d15-41b9-bea6-14e325e7f880", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1046d5d3-ab61-4ca7-a65a-36118a978256", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, null, options); - let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiPageViewStats, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, true); resolve(ret); } catch (err) { @@ -31135,24 +32543,28 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Creates the wiki resource. + * Update test suite. * - * @param {WikiInterfaces.WikiCreateParametersV2} wikiCreateParams - Parameters for the wiki creation. + * @param {TestPlanInterfaces.TestSuiteUpdateParams} testSuiteUpdateParams - Parameters for suite updation * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan that contains the suites. + * @param {number} suiteId - ID of the parent suite. */ - createWiki(wikiCreateParams, project) { + updateTestSuite(testSuiteUpdateParams, project, planId, suiteId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + planId: planId, + suiteId: suiteId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wiki", "288d122c-dbd4-451d-aa5f-7dbbba070728", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "1046d5d3-ab61-4ca7-a65a-36118a978256", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, wikiCreateParams, options); - let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiV2, false); + res = yield this.rest.update(url, testSuiteUpdateParams, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, false); resolve(ret); } catch (err) { @@ -31162,25 +32574,27 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Deletes the wiki corresponding to the wiki ID or wiki name provided. + * Find the list of all test suites in which a given test case is present. This is helpful if you need to find out which test suites are using a test case, when you need to make changes to a test case. * - * @param {string} wikiIdentifier - Wiki ID or wiki name. - * @param {string} project - Project ID or project name + * @param {number} testCaseId - ID of the test case for which suites need to be fetched. */ - deleteWiki(wikiIdentifier, project) { + getSuitesByTestCaseId(testCaseId) { return __awaiter(this, void 0, void 0, function* () { + if (testCaseId == null) { + throw new TypeError('testCaseId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - wikiIdentifier: wikiIdentifier + let routeValues = {}; + let queryValues = { + testCaseId: testCaseId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wiki", "288d122c-dbd4-451d-aa5f-7dbbba070728", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "a4080e84-f17b-4fad-84f1-7960b6525bf2", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiV2, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, true); resolve(ret); } catch (err) { @@ -31190,23 +32604,28 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Gets all wikis in a project or collection. + * Add test cases to a suite with specified configurations * + * @param {TestPlanInterfaces.SuiteTestCaseCreateUpdateParameters[]} suiteTestCaseCreateUpdateParameters - SuiteTestCaseCreateUpdateParameters object. * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan to which test cases are to be added. + * @param {number} suiteId - ID of the test suite to which test cases are to be added. */ - getAllWikis(project) { + addTestCasesToSuite(suiteTestCaseCreateUpdateParameters, project, planId, suiteId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + planId: planId, + suiteId: suiteId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wiki", "288d122c-dbd4-451d-aa5f-7dbbba070728", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiV2, true); + res = yield this.rest.create(url, suiteTestCaseCreateUpdateParameters, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestCase, true); resolve(ret); } catch (err) { @@ -31216,25 +32635,35 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Gets the wiki corresponding to the wiki ID or wiki name provided. + * Get a particular Test Case from a Suite. * - * @param {string} wikiIdentifier - Wiki ID or wiki name. * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan for which test cases are requested. + * @param {number} suiteId - ID of the test suite for which test cases are requested. + * @param {string} testCaseId - Test Case Id to be fetched. + * @param {string} witFields - Get the list of witFields. + * @param {boolean} returnIdentityRef - If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default. */ - getWiki(wikiIdentifier, project) { + getTestCase(project, planId, suiteId, testCaseId, witFields, returnIdentityRef) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier + planId: planId, + suiteId: suiteId, + testCaseId: testCaseId + }; + let queryValues = { + witFields: witFields, + returnIdentityRef: returnIdentityRef, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wiki", "288d122c-dbd4-451d-aa5f-7dbbba070728", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiV2, false); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestCase, true); resolve(ret); } catch (err) { @@ -31244,26 +32673,45 @@ class WikiApi extends basem.ClientApiBase { }); } /** - * Updates the wiki corresponding to the wiki ID or wiki name provided using the update parameters. + * Get Test Case List return those test cases which have all the configuration Ids as mentioned in the optional parameter. If configuration Ids is null, it return all the test cases * - * @param {WikiInterfaces.WikiUpdateParameters} updateParameters - Update parameters. - * @param {string} wikiIdentifier - Wiki ID or wiki name. * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan for which test cases are requested. + * @param {number} suiteId - ID of the test suite for which test cases are requested. + * @param {string} testIds - Test Case Ids to be fetched. + * @param {string} configurationIds - Fetch Test Cases which contains all the configuration Ids specified. + * @param {string} witFields - Get the list of witFields. + * @param {string} continuationToken - If the list of test cases returned is not complete, a continuation token to query next batch of test cases is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test cases. + * @param {boolean} returnIdentityRef - If set to true, returns all identity fields, like AssignedTo, ActivatedBy etc., as IdentityRef objects. If set to false, these fields are returned as unique names in string format. This is false by default. + * @param {boolean} expand - If set to false, will get a smaller payload containing only basic details about the suite test case object + * @param {TestPlanInterfaces.ExcludeFlags} excludeFlags - Flag to exclude various values from payload. For example to remove point assignments pass exclude = 1. To remove extra information (links, test plan , test suite) pass exclude = 2. To remove both extra information and point assignments pass exclude = 3 (1 + 2). + * @param {boolean} isRecursive */ - updateWiki(updateParameters, wikiIdentifier, project) { + getTestCaseList(project, planId, suiteId, testIds, configurationIds, witFields, continuationToken, returnIdentityRef, expand, excludeFlags, isRecursive) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - wikiIdentifier: wikiIdentifier + planId: planId, + suiteId: suiteId + }; + let queryValues = { + testIds: testIds, + configurationIds: configurationIds, + witFields: witFields, + continuationToken: continuationToken, + returnIdentityRef: returnIdentityRef, + expand: expand, + excludeFlags: excludeFlags, + isRecursive: isRecursive, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wiki", "288d122c-dbd4-451d-aa5f-7dbbba070728", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, updateParameters, options); - let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiV2, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestCase, true); resolve(ret); } catch (err) { @@ -31272,67 +32720,35 @@ class WikiApi extends basem.ClientApiBase { })); }); } -} -WikiApi.RESOURCE_AREA_ID = "bf7d82a0-8aa5-4613-94ef-6172a5ea01f3"; -exports.WikiApi = WikiApi; - - -/***/ }), - -/***/ 8186: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const WorkInterfaces = __nccwpck_require__(7480); -class WorkApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-Work-api', options); - } /** - * Gets backlog configuration for a team + * Removes test cases from a suite based on the list of test case Ids provided. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan from which test cases are to be removed. + * @param {number} suiteId - ID of the test suite from which test cases are to be removed. + * @param {string} testCaseIds - Test Case Ids to be removed. */ - getBacklogConfigurations(teamContext) { + removeTestCasesFromSuite(project, planId, suiteId, testCaseIds) { return __awaiter(this, void 0, void 0, function* () { + if (testCaseIds == null) { + throw new TypeError('testCaseIds can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + planId: planId, + suiteId: suiteId + }; + let queryValues = { + testCaseIds: testCaseIds, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "7799f497-3cb5-4f16-ad4f-5cd06012db64", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.BacklogConfiguration, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -31342,31 +32758,33 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get a list of work items within a backlog level + * Removes test cases from a suite based on the list of test case Ids provided. This API can be used to remove a larger number of test cases. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} backlogId + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan from which test cases are to be removed. + * @param {number} suiteId - ID of the test suite from which test cases are to be removed. + * @param {string} testIds - Comma separated string of Test Case Ids to be removed. */ - getBacklogLevelWorkItems(teamContext, backlogId) { + removeTestCasesListFromSuite(project, planId, suiteId, testIds) { return __awaiter(this, void 0, void 0, function* () { + if (testIds == null) { + throw new TypeError('testIds can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - backlogId: backlogId + planId: planId, + suiteId: suiteId + }; + let queryValues = { + testIds: testIds, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "7c468d96-ab1d-4294-a360-92f07e9ccd98", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -31377,32 +32795,28 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get a backlog level + * Update the configurations for test cases * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} id - The id of the backlog level + * @param {TestPlanInterfaces.SuiteTestCaseCreateUpdateParameters[]} suiteTestCaseCreateUpdateParameters - A SuiteTestCaseCreateUpdateParameters object. + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan to which test cases are to be updated. + * @param {number} suiteId - ID of the test suite to which test cases are to be updated. */ - getBacklog(teamContext, id) { + updateSuiteTestCases(suiteTestCaseCreateUpdateParameters, project, planId, suiteId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - id: id + planId: planId, + suiteId: suiteId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "a93726f9-7867-4e38-b4f2-0bfafc2f6a94", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testplan", "a9bd61ac-45cf-4d13-9441-43dcd01edf8d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.BacklogLevelConfiguration, false); + res = yield this.rest.update(url, suiteTestCaseCreateUpdateParameters, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestCase, true); resolve(ret); } catch (err) { @@ -31412,30 +32826,22 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * List all backlog levels - * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {TestPlanInterfaces.CloneTestCaseParams} cloneRequestBody + * @param {string} project - Project ID or project name */ - getBacklogs(teamContext) { + cloneTestCase(cloneRequestBody, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "a93726f9-7867-4e38-b4f2-0bfafc2f6a94", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "529b2b8d-82f4-4893-b1e4-1e74ea534673", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.BacklogLevelConfiguration, true); + res = yield this.rest.create(url, cloneRequestBody, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestCaseOperationInformation, false); resolve(ret); } catch (err) { @@ -31445,38 +32851,25 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Gets a badge that displays the status of columns on the board. + * Get clone information. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} id - The id of the board. - * @param {WorkInterfaces.BoardBadgeColumnOptions} columnOptions - Determines what columns to show. - * @param {string[]} columns - If columnOptions is set to custom, specify the list of column names. + * @param {string} project - Project ID or project name + * @param {number} cloneOperationId - Operation ID returned when we queue a clone operation */ - getBoardBadge(teamContext, id, columnOptions, columns) { + getTestCaseCloneInformation(project, cloneOperationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - id: id - }; - let queryValues = { - columnOptions: columnOptions, - columns: columns && columns.join(","), + cloneOperationId: cloneOperationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "0120b002-ab6c-4ca0-98cf-a8d7492f865c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "529b2b8d-82f4-4893-b1e4-1e74ea534673", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestCaseOperationInformation, false); resolve(ret); } catch (err) { @@ -31486,37 +32879,49 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Gets a badge that displays the status of columns on the board. + * Exports a set of test cases from a suite to a file. Currently supported formats: xlsx * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} id - The id of the board. - * @param {WorkInterfaces.BoardBadgeColumnOptions} columnOptions - Determines what columns to show. - * @param {string[]} columns - If columnOptions is set to custom, specify the list of column names. + * @param {TestPlanInterfaces.ExportTestCaseParams} exportTestCaseRequestBody - A ExportTestCaseParams object.ExportTestCaseParams + * @param {string} project - Project ID or project name */ - getBoardBadgeData(teamContext, id, columnOptions, columns) { + exportTestCases(exportTestCaseRequestBody, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "3b9d1c87-6b1a-4e7d-9e7d-1a8e543112bb", routeValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.post(url, JSON.stringify(exportTestCaseRequestBody), { "Accept": accept, "Content-Type": "application/json" })).message); + } + catch (err) { + reject(err); } + })); + }); + } + /** + * Delete a test case. + * + * @param {string} project - Project ID or project name + * @param {number} testCaseId - Id of test case to be deleted. + */ + deleteTestCase(project, testCaseId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - team: team, - id: id - }; - let queryValues = { - columnOptions: columnOptions, - columns: columns && columns.join(","), + testCaseId: testCaseId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "0120b002-ab6c-4ca0-98cf-a8d7492f865c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "29006fb5-816b-4ff7-a329-599943569229", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -31527,23 +32932,27 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get available board columns in a project + * Get a list of deleted test plans * * @param {string} project - Project ID or project name + * @param {string} continuationToken - If the list of plans returned is not complete, a continuation token to query next batch of plans is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test plans. */ - getColumnSuggestedValues(project) { + getDeletedTestPlans(project, continuationToken) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + continuationToken: continuationToken, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "eb7ec5a3-1ba3-4fd1-b834-49a5a387e57d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "04c64b80-239e-426c-b79d-b1ca8951ce26", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPlan, true); resolve(ret); } catch (err) { @@ -31553,42 +32962,26 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Returns the list of parent field filter model for the given list of workitem ids + * Restores the deleted test plan * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} childBacklogContextCategoryRefName - * @param {number[]} workitemIds + * @param {TestPlanInterfaces.TestPlanAndSuiteRestoreModel} restoreModel - The model containing the restore information + * @param {string} project - Project ID or project name + * @param {number} planId - The ID of the test plan to restore */ - getBoardMappingParentItems(teamContext, childBacklogContextCategoryRefName, workitemIds) { + restoreDeletedTestPlan(restoreModel, project, planId) { return __awaiter(this, void 0, void 0, function* () { - if (childBacklogContextCategoryRefName == null) { - throw new TypeError('childBacklogContextCategoryRefName can not be null or undefined'); - } - if (workitemIds == null) { - throw new TypeError('workitemIds can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team - }; - let queryValues = { - childBacklogContextCategoryRefName: childBacklogContextCategoryRefName, - workitemIds: workitemIds && workitemIds.join(","), + planId: planId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "186abea3-5c35-432f-9e28-7a15b4312a0e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "04c64b80-239e-426c-b79d-b1ca8951ce26", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.update(url, restoreModel, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -31598,23 +32991,28 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get available board rows in a project + * Clone test plan * + * @param {TestPlanInterfaces.CloneTestPlanParams} cloneRequestBody - Plan Clone Request Body detail TestPlanCloneRequest * @param {string} project - Project ID or project name + * @param {boolean} deepClone - Clones all the associated test cases as well */ - getRowSuggestedValues(project) { + cloneTestPlan(cloneRequestBody, project, deepClone) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + deepClone: deepClone, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "bb494cc6-a0f5-4c6c-8dca-ea6912e79eb9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "e65df662-d8a3-46c7-ae1c-14e2d4df57e1", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, cloneRequestBody, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestPlanOperationInformation, false); resolve(ret); } catch (err) { @@ -31624,32 +33022,25 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get board + * Get clone information. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} id - identifier for board, either board's backlog level name (Eg:"Stories") or Id + * @param {string} project - Project ID or project name + * @param {number} cloneOperationId - Operation ID returned when we queue a clone operation */ - getBoard(teamContext, id) { + getCloneInformation(project, cloneOperationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - id: id + cloneOperationId: cloneOperationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "23ad19fc-3b8e-4877-8462-b3f92bc06b40", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "e65df662-d8a3-46c7-ae1c-14e2d4df57e1", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.Board, false); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestPlanOperationInformation, false); resolve(ret); } catch (err) { @@ -31659,30 +33050,38 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get boards + * Get a particular Test Point from a suite. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan for which test points are requested. + * @param {number} suiteId - ID of the test suite for which test points are requested. + * @param {string} pointId - ID of test point to be fetched. + * @param {boolean} returnIdentityRef - If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + * @param {boolean} includePointDetails - If set to false, will get a smaller payload containing only basic details about the test point object */ - getBoards(teamContext) { + getPoints(project, planId, suiteId, pointId, returnIdentityRef, includePointDetails) { return __awaiter(this, void 0, void 0, function* () { + if (pointId == null) { + throw new TypeError('pointId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + planId: planId, + suiteId: suiteId + }; + let queryValues = { + pointId: pointId, + returnIdentityRef: returnIdentityRef, + includePointDetails: includePointDetails, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "23ad19fc-3b8e-4877-8462-b3f92bc06b40", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "52df686e-bae4-4334-b0ee-b6cf4e6f6b73", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPoint, true); resolve(ret); } catch (err) { @@ -31692,33 +33091,41 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update board options + * Get all the points inside a suite based on some filters * - * @param {{ [key: string] : string; }} options - options to updated - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} id - identifier for board, either category plural name (Eg:"Stories") or guid + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan for which test points are requested. + * @param {number} suiteId - ID of the test suite for which test points are requested + * @param {string} testPointIds - ID of test points to fetch. + * @param {string} testCaseId - Get Test Points for specific test case Ids. + * @param {string} continuationToken - If the list of test point returned is not complete, a continuation token to query next batch of test points is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test points. + * @param {boolean} returnIdentityRef - If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. + * @param {boolean} includePointDetails - If set to false, will get a smaller payload containing only basic details about the test point object + * @param {boolean} isRecursive - If set to true, will also fetch test points belonging to child suites recursively. */ - setBoardOptions(options, teamContext, id) { + getPointsList(project, planId, suiteId, testPointIds, testCaseId, continuationToken, returnIdentityRef, includePointDetails, isRecursive) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - id: id + planId: planId, + suiteId: suiteId + }; + let queryValues = { + testPointIds: testPointIds, + testCaseId: testCaseId, + continuationToken: continuationToken, + returnIdentityRef: returnIdentityRef, + includePointDetails: includePointDetails, + isRecursive: isRecursive, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "23ad19fc-3b8e-4877-8462-b3f92bc06b40", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "52df686e-bae4-4334-b0ee-b6cf4e6f6b73", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, options, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPoint, true); resolve(ret); } catch (err) { @@ -31728,32 +33135,34 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get board user settings for a board id + * Update Test Points. This is used to Reset test point to active, update the outcome of a test point or update the tester of a test point * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board - Board ID or Name + * @param {TestPlanInterfaces.TestPointUpdateParams[]} testPointUpdateParams - A TestPointUpdateParams Object. + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan for which test points are requested. + * @param {number} suiteId - ID of the test suite for which test points are requested. + * @param {boolean} includePointDetails - If set to false, will get a smaller payload containing only basic details about the test point object + * @param {boolean} returnIdentityRef - If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object. */ - getBoardUserSettings(teamContext, board) { + updateTestPoints(testPointUpdateParams, project, planId, suiteId, includePointDetails, returnIdentityRef) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - board: board + planId: planId, + suiteId: suiteId + }; + let queryValues = { + includePointDetails: includePointDetails, + returnIdentityRef: returnIdentityRef, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "b30d9f58-1891-4b0a-b168-c46408f919b0", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "52df686e-bae4-4334-b0ee-b6cf4e6f6b73", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, testPointUpdateParams, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestPoint, true); resolve(ret); } catch (err) { @@ -31763,33 +33172,33 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update board user settings for the board id + * Get Deleted Test Suites for a Test Plan. * - * @param {{ [key: string] : string; }} boardUserSettings - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board + * @param {string} project - Project ID or project name + * @param {number} planId - ID of the test plan for which suites are requested. + * @param {TestPlanInterfaces.SuiteExpand} expand - Include the children suites and testers details. + * @param {string} continuationToken - If the list of suites returned is not complete, a continuation token to query next batch of suites is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test suites. + * @param {boolean} asTreeView - If the suites returned should be in a tree structure. */ - updateBoardUserSettings(boardUserSettings, teamContext, board) { + getDeletedTestSuitesForPlan(project, planId, expand, continuationToken, asTreeView) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - board: board + planId: planId + }; + let queryValues = { + expand: expand, + continuationToken: continuationToken, + asTreeView: asTreeView, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "b30d9f58-1891-4b0a-b168-c46408f919b0", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "d2f1e8a4-3b6e-4f8b-9c8e-2d4f6e4b5a7c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, boardUserSettings, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, true); resolve(ret); } catch (err) { @@ -31799,32 +33208,31 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get a team's capacity including total capacity and days off + * Get Deleted Test Suites within a Project. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} iterationId - ID of the iteration + * @param {string} project - Project ID or project name + * @param {TestPlanInterfaces.SuiteExpand} expand - Include the children suites and testers details. + * @param {string} continuationToken - If the list of suites returned is not complete, a continuation token to query next batch of suites is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test suites. + * @param {boolean} asTreeView - If the suites returned should be in a tree structure. */ - getCapacitiesWithIdentityRefAndTotals(teamContext, iterationId) { + getDeletedTestSuitesForProject(project, expand, continuationToken, asTreeView) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - iterationId: iterationId + project: project + }; + let queryValues = { + expand: expand, + continuationToken: continuationToken, + asTreeView: asTreeView, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "work", "74412d15-8c1a-4352-a48d-ef1ed5587d57", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "f40ae369-855d-4d5e-bee0-5e99c5c42fcb", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamCapacity, false); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestSuite, true); resolve(ret); } catch (err) { @@ -31834,34 +33242,26 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get a team member's capacity + * Restores the deleted test suite * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} iterationId - ID of the iteration - * @param {string} teamMemberId - ID of the team member + * @param {TestPlanInterfaces.TestPlanAndSuiteRestoreModel} payload - The model containing the restore information + * @param {string} project - Project ID or project name + * @param {number} suiteId - The ID of the test suite to restore */ - getCapacityWithIdentityRef(teamContext, iterationId, teamMemberId) { + restoreDeletedTestSuite(payload, project, suiteId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - iterationId: iterationId, - teamMemberId: teamMemberId + suiteId: suiteId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "work", "74412d15-8c1a-4352-a48d-ef1ed5587d57", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "f40ae369-855d-4d5e-bee0-5e99c5c42fcb", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamMemberCapacityIdentityRef, false); + res = yield this.rest.update(url, payload, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -31871,33 +33271,28 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Replace a team's capacity + * Clone test suite * - * @param {WorkInterfaces.TeamMemberCapacityIdentityRef[]} capacities - Team capacity to replace - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} iterationId - ID of the iteration + * @param {TestPlanInterfaces.CloneTestSuiteParams} cloneRequestBody - Suite Clone Request Body detail TestSuiteCloneRequest + * @param {string} project - Project ID or project name + * @param {boolean} deepClone - Clones all the associated test cases as well */ - replaceCapacitiesWithIdentityRef(capacities, teamContext, iterationId) { + cloneTestSuite(cloneRequestBody, project, deepClone) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - iterationId: iterationId + project: project + }; + let queryValues = { + deepClone: deepClone, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "work", "74412d15-8c1a-4352-a48d-ef1ed5587d57", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "181d4c97-0e98-4ee2-ad6a-4cada675e555", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, capacities, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamMemberCapacityIdentityRef, true); + res = yield this.rest.create(url, cloneRequestBody, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestSuiteOperationInformation, false); resolve(ret); } catch (err) { @@ -31907,35 +33302,25 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update a team member's capacity + * Get clone information. * - * @param {WorkInterfaces.CapacityPatch} patch - Updated capacity - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} iterationId - ID of the iteration - * @param {string} teamMemberId - ID of the team member + * @param {string} project - Project ID or project name + * @param {number} cloneOperationId - Operation ID returned when we queue a clone operation */ - updateCapacityWithIdentityRef(patch, teamContext, iterationId, teamMemberId) { + getSuiteCloneInformation(project, cloneOperationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - iterationId: iterationId, - teamMemberId: teamMemberId + cloneOperationId: cloneOperationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "work", "74412d15-8c1a-4352-a48d-ef1ed5587d57", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testplan", "181d4c97-0e98-4ee2-ad6a-4cada675e555", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, patch, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamMemberCapacityIdentityRef, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.CloneTestSuiteOperationInformation, false); resolve(ret); } catch (err) { @@ -31945,32 +33330,24 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get board card Rule settings for the board id or board by name + * Create a test variable. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board + * @param {TestPlanInterfaces.TestVariableCreateUpdateParameters} testVariableCreateUpdateParameters - TestVariableCreateUpdateParameters + * @param {string} project - Project ID or project name */ - getBoardCardRuleSettings(teamContext, board) { + createTestVariable(testVariableCreateUpdateParameters, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - board: board + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "work", "b044a3d9-02ea-49c7-91a1-b730949cc896", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, testVariableCreateUpdateParameters, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestVariable, false); resolve(ret); } catch (err) { @@ -31980,32 +33357,24 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update board card Rule settings for the board id or board by name + * Delete a test variable by its ID. * - * @param {WorkInterfaces.BoardCardRuleSettings} boardCardRuleSettings - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board + * @param {string} project - Project ID or project name + * @param {number} testVariableId - ID of the test variable to delete. */ - updateBoardCardRuleSettings(boardCardRuleSettings, teamContext, board) { + deleteTestVariable(project, testVariableId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - board: board + testVariableId: testVariableId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "work", "b044a3d9-02ea-49c7-91a1-b730949cc896", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, boardCardRuleSettings, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -32016,31 +33385,25 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update taskboard card Rule settings + * Get a test variable by its ID. * - * @param {WorkInterfaces.BoardCardRuleSettings} boardCardRuleSettings - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} project - Project ID or project name + * @param {number} testVariableId - ID of the test variable to get. */ - updateTaskboardCardRuleSettings(boardCardRuleSettings, teamContext) { + getTestVariableById(project, testVariableId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + testVariableId: testVariableId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "work", "3f84a8d1-1aab-423e-a94b-6dcbdcca511f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, boardCardRuleSettings, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestVariable, false); resolve(ret); } catch (err) { @@ -32050,32 +33413,27 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get board card settings for the board id or board by name + * Get a list of test variables. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board + * @param {string} project - Project ID or project name + * @param {string} continuationToken - If the list of variables returned is not complete, a continuation token to query next batch of variables is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test variables. */ - getBoardCardSettings(teamContext, board) { + getTestVariables(project, continuationToken) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - board: board + project: project + }; + let queryValues = { + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "work", "07c3b467-bc60-4f05-8e34-599ce288fafc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestVariable, true); resolve(ret); } catch (err) { @@ -32085,33 +33443,26 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update board card settings for the board id or board by name + * Update a test variable by its ID. * - * @param {WorkInterfaces.BoardCardSettings} boardCardSettingsToSave - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board + * @param {TestPlanInterfaces.TestVariableCreateUpdateParameters} testVariableCreateUpdateParameters - TestVariableCreateUpdateParameters + * @param {string} project - Project ID or project name + * @param {number} testVariableId - ID of the test variable to update. */ - updateBoardCardSettings(boardCardSettingsToSave, teamContext, board) { + updateTestVariable(testVariableCreateUpdateParameters, project, testVariableId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - board: board + testVariableId: testVariableId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "work", "07c3b467-bc60-4f05-8e34-599ce288fafc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testplan", "2c61fac6-ac4e-45a5-8c38-1c2b8fd8ea6c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, boardCardSettingsToSave, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, testVariableCreateUpdateParameters, options); + let ret = this.formatResponse(res.result, TestPlanInterfaces.TypeInfo.TestVariable, false); resolve(ret); } catch (err) { @@ -32120,31 +33471,72 @@ class WorkApi extends basem.ClientApiBase { })); }); } +} +exports.TestPlanApi = TestPlanApi; + + +/***/ }), + +/***/ 1819: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TestResultsApi = void 0; +const basem = __nccwpck_require__(273); +const Contracts = __nccwpck_require__(3047); +class TestResultsApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-testResults-api', options); + } /** - * Update taskboard card settings - * - * @param {WorkInterfaces.BoardCardSettings} boardCardSettingsToSave - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} iterationId + * @param {string} actionPath */ - updateTaskboardCardSettings(boardCardSettingsToSave, teamContext) { + createTestIterationResultAttachment(attachmentRequestModel, project, runId, testCaseResultId, iterationId, actionPath) { return __awaiter(this, void 0, void 0, function* () { + if (iterationId == null) { + throw new TypeError('iterationId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + runId: runId, + testCaseResultId: testCaseResultId + }; + let queryValues = { + iterationId: iterationId, + actionPath: actionPath, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "work", "0d63745f-31f3-4cf3-9056-2a064e567637", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, boardCardSettingsToSave, options); + res = yield this.rest.create(url, attachmentRequestModel, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -32155,33 +33547,25 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get a board chart - * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board - Identifier for board, either board's backlog level name (Eg:"Stories") or Id - * @param {string} name - The chart name + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId */ - getBoardChart(teamContext, board, name) { + createTestResultAttachment(attachmentRequestModel, project, runId, testCaseResultId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - board: board, - name: name + runId: runId, + testCaseResultId: testCaseResultId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "45fe888c-239e-49fd-958c-df1a1ab21d97", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.create(url, attachmentRequestModel, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -32192,32 +33576,33 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get board charts - * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board - Identifier for board, either board's backlog level name (Eg:"Stories") or Id + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} testSubResultId */ - getBoardCharts(teamContext, board) { + createTestSubResultAttachment(attachmentRequestModel, project, runId, testCaseResultId, testSubResultId) { return __awaiter(this, void 0, void 0, function* () { + if (testSubResultId == null) { + throw new TypeError('testSubResultId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - board: board + runId: runId, + testCaseResultId: testCaseResultId + }; + let queryValues = { + testSubResultId: testSubResultId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "45fe888c-239e-49fd-958c-df1a1ab21d97", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, attachmentRequestModel, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -32227,34 +33612,26 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update a board chart - * - * @param {WorkInterfaces.BoardChart} chart - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board - Identifier for board, either board's backlog level name (Eg:"Stories") or Id - * @param {string} name - The chart name + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId */ - updateBoardChart(chart, teamContext, board, name) { + deleteTestResultAttachment(project, runId, testCaseResultId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - board: board, - name: name + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "45fe888c-239e-49fd-958c-df1a1ab21d97", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, chart, options); + res = yield this.rest.del(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -32265,33 +33642,35 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get columns on a board + * Returns a test iteration attachment * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board - Name or ID of the specific board + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId + * @param {number} iterationId */ - getBoardColumns(teamContext, board) { + getTestIterationAttachmentContent(project, runId, testCaseResultId, attachmentId, iterationId) { return __awaiter(this, void 0, void 0, function* () { + if (iterationId == null) { + throw new TypeError('iterationId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - board: board + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId + }; + let queryValues = { + iterationId: iterationId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "c555d7ff-84e1-47df-9923-a3fe0cd8751b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.BoardColumn, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -32300,34 +33679,35 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update columns on a board + * Returns a test iteration attachment * - * @param {WorkInterfaces.BoardColumn[]} boardColumns - List of board columns to update - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board - Name or ID of the specific board + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId + * @param {number} iterationId */ - updateBoardColumns(boardColumns, teamContext, board) { + getTestIterationAttachmentZip(project, runId, testCaseResultId, attachmentId, iterationId) { return __awaiter(this, void 0, void 0, function* () { + if (iterationId == null) { + throw new TypeError('iterationId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - board: board + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId + }; + let queryValues = { + iterationId: iterationId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "c555d7ff-84e1-47df-9923-a3fe0cd8751b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.replace(url, boardColumns, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.BoardColumn, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -32336,34 +33716,28 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get Delivery View Data + * Returns a test result attachment * * @param {string} project - Project ID or project name - * @param {string} id - Identifier for delivery view - * @param {number} revision - Revision of the plan for which you want data. If the current plan is a different revision you will get an ViewRevisionMismatchException exception. If you do not supply a revision you will get data for the latest revision. - * @param {Date} startDate - The start date of timeline - * @param {Date} endDate - The end date of timeline + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId */ - getDeliveryTimelineData(project, id, revision, startDate, endDate) { + getTestResultAttachmentContent(project, runId, testCaseResultId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id - }; - let queryValues = { - revision: revision, - startDate: startDate, - endDate: endDate, + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "bdd0834e-101f-49f0-a6ae-509f384a12b4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.DeliveryViewData, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -32372,25 +33746,25 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get an iteration's capacity for all teams in iteration - * * @param {string} project - Project ID or project name - * @param {string} iterationId - ID of the iteration + * @param {number} runId + * @param {number} testCaseResultId */ - getTotalIterationCapacities(project, iterationId) { + getTestResultAttachments(project, runId, testCaseResultId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - iterationId: iterationId + runId: runId, + testCaseResultId: testCaseResultId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "1e385ce0-396b-4273-8171-d64562c18d37", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestAttachment, true); resolve(ret); } catch (err) { @@ -32400,33 +33774,28 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Delete a team's iteration by iterationId + * Returns a test result attachment * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} id - ID of the iteration + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId */ - deleteTeamIteration(teamContext, id) { + getTestResultAttachmentZip(project, runId, testCaseResultId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - id: id + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "c9175577-28a1-4b06-9197-8636af9f64ad", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -32435,33 +33804,35 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get team's iteration by iterationId + * Returns a test sub result attachment * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} id - ID of the iteration + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId + * @param {number} testSubResultId */ - getTeamIteration(teamContext, id) { + getTestSubResultAttachmentContent(project, runId, testCaseResultId, attachmentId, testSubResultId) { return __awaiter(this, void 0, void 0, function* () { + if (testSubResultId == null) { + throw new TypeError('testSubResultId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - id: id + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId + }; + let queryValues = { + testSubResultId: testSubResultId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "c9175577-28a1-4b06-9197-8636af9f64ad", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSettingsIteration, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -32470,34 +33841,34 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get a team's iterations using timeframe filter + * Returns attachment references for test sub result. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} timeframe - A filter for which iterations are returned based on relative time. Only Current is supported currently. + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} testSubResultId */ - getTeamIterations(teamContext, timeframe) { + getTestSubResultAttachments(project, runId, testCaseResultId, testSubResultId) { return __awaiter(this, void 0, void 0, function* () { + if (testSubResultId == null) { + throw new TypeError('testSubResultId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + runId: runId, + testCaseResultId: testCaseResultId }; let queryValues = { - '$timeframe': timeframe, + testSubResultId: testSubResultId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "c9175577-28a1-4b06-9197-8636af9f64ad", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSettingsIteration, true); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestAttachment, true); resolve(ret); } catch (err) { @@ -32507,32 +33878,35 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Add an iteration to the team + * Returns a test sub result attachment * - * @param {WorkInterfaces.TeamSettingsIteration} iteration - Iteration to add - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId + * @param {number} attachmentId + * @param {number} testSubResultId */ - postTeamIteration(iteration, teamContext) { + getTestSubResultAttachmentZip(project, runId, testCaseResultId, attachmentId, testSubResultId) { return __awaiter(this, void 0, void 0, function* () { + if (testSubResultId == null) { + throw new TypeError('testSubResultId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + runId: runId, + testCaseResultId: testCaseResultId, + attachmentId: attachmentId + }; + let queryValues = { + testSubResultId: testSubResultId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "c9175577-28a1-4b06-9197-8636af9f64ad", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "2a632e97-e014-4275-978f-8e5c4906d4b3", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, iteration, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSettingsIteration, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -32541,24 +33915,24 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Add a new plan for the team - * - * @param {WorkInterfaces.CreatePlan} postedPlan - Plan definition + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel * @param {string} project - Project ID or project name + * @param {number} runId */ - createPlan(postedPlan, project) { + createTestRunAttachment(attachmentRequestModel, project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "0b42cb47-cd73-4810-ac90-19c9ba147453", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b5731898-8206-477a-a51d-3fdf116fc6bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, postedPlan, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.Plan, false); + res = yield this.rest.create(url, attachmentRequestModel, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -32568,20 +33942,20 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Delete the specified plan - * * @param {string} project - Project ID or project name - * @param {string} id - Identifier of the plan + * @param {number} runId + * @param {number} attachmentId */ - deletePlan(project, id) { + deleteTestRunAttachment(project, runId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id + runId: runId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "0b42cb47-cd73-4810-ac90-19c9ba147453", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b5731898-8206-477a-a51d-3fdf116fc6bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -32596,26 +33970,26 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get the information for the specified plan + * Returns a test run attachment * * @param {string} project - Project ID or project name - * @param {string} id - Identifier of the plan + * @param {number} runId + * @param {number} attachmentId */ - getPlan(project, id) { + getTestRunAttachmentContent(project, runId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id + runId: runId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "0b42cb47-cd73-4810-ac90-19c9ba147453", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b5731898-8206-477a-a51d-3fdf116fc6bf", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.Plan, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -32624,23 +33998,23 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get the information for all the plans configured for the given team - * * @param {string} project - Project ID or project name + * @param {number} runId */ - getPlans(project) { + getTestRunAttachments(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "0b42cb47-cd73-4810-ac90-19c9ba147453", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b5731898-8206-477a-a51d-3fdf116fc6bf", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.Plan, true); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestAttachment, true); resolve(ret); } catch (err) { @@ -32650,27 +34024,26 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update the information for the specified plan + * Returns a test run attachment * - * @param {WorkInterfaces.UpdatePlan} updatedPlan - Plan definition to be updated * @param {string} project - Project ID or project name - * @param {string} id - Identifier of the plan + * @param {number} runId + * @param {number} attachmentId */ - updatePlan(updatedPlan, project, id) { + getTestRunAttachmentZip(project, runId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id + runId: runId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "0b42cb47-cd73-4810-ac90-19c9ba147453", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b5731898-8206-477a-a51d-3fdf116fc6bf", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.replace(url, updatedPlan, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.Plan, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -32679,23 +34052,25 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get process configuration - * * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} testCaseResultId */ - getProcessConfiguration(project) { + getBugsLinkedToTestResult(project, runId, testCaseResultId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId, + testCaseResultId: testCaseResultId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "f901ba42-86d2-4b0c-89c1-3f86d06daa84", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "d8dbf98f-eb34-4f8d-8365-47972af34f29", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -32705,32 +34080,28 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get rows on a board - * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board - Name or ID of the specific board + * @param {string} project - Project ID or project name + * @param {number} buildId */ - getBoardRows(teamContext, board) { + fetchSourceCodeCoverageReport(project, buildId) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - board: board + project: project + }; + let queryValues = { + buildId: buildId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "0863355d-aefd-4d63-8669-984c9b7b0e78", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "a459e10b-d703-4193-b3c1-60f2287918b3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.SourceViewBuildCoverage, true); resolve(ret); } catch (err) { @@ -32740,33 +34111,33 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update rows on a board - * - * @param {WorkInterfaces.BoardRow[]} boardRows - List of board rows to update - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} board - Name or ID of the specific board + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} flags */ - updateBoardRows(boardRows, teamContext, board) { + getBuildCodeCoverage(project, buildId, flags) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } + if (flags == null) { + throw new TypeError('flags can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - board: board + project: project + }; + let queryValues = { + buildId: buildId, + flags: flags, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "0863355d-aefd-4d63-8669-984c9b7b0e78", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "9b3e1ece-c6ab-4fbb-8167-8a32a0c92216", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, boardRows, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.BuildCoverage, true); resolve(ret); } catch (err) { @@ -32776,28 +34147,32 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10&deltaBuildId=9 Request: build id and delta build id (optional) + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {number} deltaBuildId */ - getColumns(teamContext) { + getCodeCoverageSummary(project, buildId, deltaBuildId) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team + project: project + }; + let queryValues = { + buildId: buildId, + deltaBuildId: deltaBuildId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "c6815dbe-8e7e-4ffe-9a79-e83ee712aa92", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "9b3e1ece-c6ab-4fbb-8167-8a32a0c92216", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.CodeCoverageSummary, false); resolve(ret); } catch (err) { @@ -32807,28 +34182,30 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * @param {WorkInterfaces.UpdateTaskboardColumn[]} updateColumns - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary + * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {Contracts.CodeCoverageData} coverageData */ - updateColumns(updateColumns, teamContext) { + updateCodeCoverageSummary(project, buildId, coverageData) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team + project: project + }; + let queryValues = { + buildId: buildId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "c6815dbe-8e7e-4ffe-9a79-e83ee712aa92", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "9b3e1ece-c6ab-4fbb-8167-8a32a0c92216", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, updateColumns, options); + res = yield this.rest.create(url, coverageData, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -32839,25 +34216,25 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} iterationId + * @param {string} project - Project ID or project name + * @param {number} runId + * @param {number} flags */ - getWorkItemColumns(teamContext, iterationId) { + getTestRunCodeCoverage(project, runId, flags) { return __awaiter(this, void 0, void 0, function* () { + if (flags == null) { + throw new TypeError('flags can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - iterationId: iterationId + runId: runId + }; + let queryValues = { + flags: flags, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "1be23c36-8872-4abc-b57d-402cd6c669d9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "5641efbc-6f9b-401a-baeb-d3da22489e5e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -32872,33 +34249,24 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * @param {WorkInterfaces.UpdateTaskboardWorkItemColumn} updateColumn - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} iterationId - * @param {number} workItemId + * Creates custom test fields based on the data provided. + * + * @param {Contracts.CustomTestFieldDefinition[]} newFields - NewFields is an array of type CustomTestFieldDefinition. + * @param {string} project - Project ID or project name */ - updateWorkItemColumn(updateColumn, teamContext, iterationId, workItemId) { + addCustomFields(newFields, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - iterationId: iterationId, - workItemId: workItemId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "1be23c36-8872-4abc-b57d-402cd6c669d9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b67d46d8-b70e-4dcc-a98c-7f74b52ba82f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, updateColumn, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, newFields, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.CustomTestFieldDefinition, true); resolve(ret); } catch (err) { @@ -32908,32 +34276,30 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get team's days off for an iteration + * Returns List of custom test fields for the given custom test field scope. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} iterationId - ID of the iteration + * @param {string} project - Project ID or project name + * @param {Contracts.CustomTestFieldScope} scopeFilter - Scope of custom test fields which are to be returned. */ - getTeamDaysOff(teamContext, iterationId) { + queryCustomFields(project, scopeFilter) { return __awaiter(this, void 0, void 0, function* () { + if (scopeFilter == null) { + throw new TypeError('scopeFilter can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - iterationId: iterationId + project: project + }; + let queryValues = { + scopeFilter: scopeFilter, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "2d4faa2e-9150-4cbf-a47a-932b1b4a0773", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "b67d46d8-b70e-4dcc-a98c-7f74b52ba82f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSettingsDaysOff, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.CustomTestFieldDefinition, true); resolve(ret); } catch (err) { @@ -32943,33 +34309,25 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Set a team's days off for an iteration + * Returns details of the custom test field for the specified testExtensionFieldId. * - * @param {WorkInterfaces.TeamSettingsDaysOffPatch} daysOffPatch - Team's days off patch containing a list of start and end dates - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} iterationId - ID of the iteration + * @param {string} project - Project ID or project name + * @param {number} testExtensionFieldId - Custom test field id which has to be deleted. */ - updateTeamDaysOff(daysOffPatch, teamContext, iterationId) { + deleteCustomFieldById(project, testExtensionFieldId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - iterationId: iterationId + testExtensionFieldId: testExtensionFieldId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "2d4faa2e-9150-4cbf-a47a-932b1b4a0773", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "75653fea-8649-4e07-b296-ca20e1bb5633", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, daysOffPatch, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSettingsDaysOff, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -32979,30 +34337,24 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get a collection of team field values + * Returns details of the custom test field which is updated. * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {Contracts.CustomTestFieldUpdateDefinition} updateCustomTestField - Custom test field which has to be updated. + * @param {string} project - Project ID or project name */ - getTeamFieldValues(teamContext) { + updateCustomField(updateCustomTestField, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "07ced576-58ed-49e6-9c1e-5cb53ab8bf2a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "75653fea-8649-4e07-b296-ca20e1bb5633", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, updateCustomTestField, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.CustomTestFieldDefinition, false); resolve(ret); } catch (err) { @@ -33012,31 +34364,58 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update team field values + * Get file coverage for the specified file * - * @param {WorkInterfaces.TeamFieldValuesPatch} patch - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {Contracts.FileCoverageRequest} fileCoverageRequest - File details with pull request iteration context + * @param {string} project - Project ID or project name */ - updateTeamFieldValues(patch, teamContext) { + getFileLevelCodeCoverage(fileCoverageRequest, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "4a6d0c46-51ca-45aa-9163-249cee3289b7", routeValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.post(url, JSON.stringify(fileCoverageRequest), { "Accept": accept, "Content-Type": "application/json" })).message); + } + catch (err) { + reject(err); } + })); + }); + } + /** + * @param {string} project - Project ID or project name + * @param {number} buildDefinitionId + * @param {Date} minBuildCreatedDate + */ + getFlakyTestResultsByBuildDefinitionId(project, buildDefinitionId, minBuildCreatedDate) { + return __awaiter(this, void 0, void 0, function* () { + if (buildDefinitionId == null) { + throw new TypeError('buildDefinitionId can not be null or undefined'); + } + if (minBuildCreatedDate == null) { + throw new TypeError('minBuildCreatedDate can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - team: team + project: project + }; + let queryValues = { + buildDefinitionId: buildDefinitionId, + minBuildCreatedDate: minBuildCreatedDate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "07ced576-58ed-49e6-9c1e-5cb53ab8bf2a", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "8ed3cf63-7153-4722-a107-c49dae996143", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, patch, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -33046,30 +34425,23 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get a team's settings - * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} project - Project ID or project name + * @param {number} runId */ - getTeamSettings(teamContext) { + getFlakyTestResultsByTestRun(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "c3c1012b-bea7-49d7-b45e-1664e566f84c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "31cc4b31-416f-45cd-9b45-39534279e10c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSetting, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -33079,31 +34451,22 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Update a team's settings - * - * @param {WorkInterfaces.TeamSettingsPatch} teamSettingsPatch - TeamSettings changes - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {Contracts.ResultsFilter} filter + * @param {string} project - Project ID or project name */ - updateTeamSettings(teamSettingsPatch, teamContext) { + queryTestResultHistory(filter, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "c3c1012b-bea7-49d7-b45e-1664e566f84c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "bdf7a97b-0395-4da8-9d5d-f957619327d1", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, teamSettingsPatch, options); - let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSetting, false); + res = yield this.rest.create(url, filter, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultHistory, false); resolve(ret); } catch (err) { @@ -33113,32 +34476,25 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Get work items for iteration + * Get test run message logs * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} iterationId - ID of the iteration + * @param {string} project - Project ID or project name + * @param {number} runId - ID of the run to get. */ - getIterationWorkItems(teamContext, iterationId) { + getTestRunMessageLogs(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - iterationId: iterationId + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "5b3ef1a6-d3ab-44cd-bafd-c7f45db850fa", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "e9ab0c6a-1984-418b-87c0-ee4202318ba3", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestMessageLogDetails, true); resolve(ret); } catch (err) { @@ -33148,31 +34504,40 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Reorder Product Backlog/Boards Work Items + * Get summary of test results. * - * @param {WorkInterfaces.ReorderOperation} operation - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} project - Project ID or project name + * @param {number} pipelineId - Pipeline Id. This is same as build Id. + * @param {string} stageName - Name of the stage. Maximum supported length for name is 256 character. + * @param {string} phaseName - Name of the phase. Maximum supported length for name is 256 character. + * @param {string} jobName - Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + * @param {Contracts.Metrics[]} metricNames + * @param {boolean} groupByNode - Group summary for each node of the pipleine heirarchy */ - reorderBacklogWorkItems(operation, teamContext) { + getTestPipelineMetrics(project, pipelineId, stageName, phaseName, jobName, metricNames, groupByNode) { return __awaiter(this, void 0, void 0, function* () { + if (pipelineId == null) { + throw new TypeError('pipelineId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team + project: project + }; + let queryValues = { + pipelineId: pipelineId, + stageName: stageName, + phaseName: phaseName, + jobName: jobName, + metricNames: metricNames && metricNames.join(","), + groupByNode: groupByNode, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "1c22b714-e7e4-41b9-85e0-56ee13ef55ed", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "65f35817-86a1-4131-b38b-3ec2d4744e53", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, operation, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.PipelineTestMetrics, false); resolve(ret); } catch (err) { @@ -33182,33 +34547,40 @@ class WorkApi extends basem.ClientApiBase { }); } /** - * Reorder Sprint Backlog/Taskboard Work Items - * - * @param {WorkInterfaces.ReorderOperation} operation - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} iterationId - The id of the iteration + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} publishContext + * @param {string} groupBy + * @param {string} filter + * @param {string} orderby + * @param {boolean} shouldIncludeResults + * @param {boolean} queryRunSummaryForInProgress */ - reorderIterationWorkItems(operation, teamContext, iterationId) { + getTestResultDetailsForBuild(project, buildId, publishContext, groupBy, filter, orderby, shouldIncludeResults, queryRunSummaryForInProgress) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - iterationId: iterationId + project: project + }; + let queryValues = { + buildId: buildId, + publishContext: publishContext, + groupBy: groupBy, + '$filter': filter, + '$orderby': orderby, + shouldIncludeResults: shouldIncludeResults, + queryRunSummaryForInProgress: queryRunSummaryForInProgress, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "work", "47755db2-d7eb-405a-8c25-675401525fc9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "a518c749-4524-45b2-a7ef-1ac009b312cd", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, operation, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsDetails, false); resolve(ret); } catch (err) { @@ -33217,61 +34589,46 @@ class WorkApi extends basem.ClientApiBase { })); }); } -} -WorkApi.RESOURCE_AREA_ID = "1d4f49f9-02b9-4e26-b826-2cdb6195f2a9"; -exports.WorkApi = WorkApi; - - -/***/ }), - -/***/ 8409: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const WorkItemTrackingInterfaces = __nccwpck_require__(6938); -class WorkItemTrackingApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-WorkItemTracking-api', options); - } /** - * INTERNAL ONLY: USED BY ACCOUNT MY WORK PAGE. This returns Doing, Done, Follows and activity work items details. - * - * @param {WorkItemTrackingInterfaces.QueryOption} queryOption + * @param {string} project - Project ID or project name + * @param {number} releaseId + * @param {number} releaseEnvId + * @param {string} publishContext + * @param {string} groupBy + * @param {string} filter + * @param {string} orderby + * @param {boolean} shouldIncludeResults + * @param {boolean} queryRunSummaryForInProgress */ - getAccountMyWorkData(queryOption) { + getTestResultDetailsForRelease(project, releaseId, releaseEnvId, publishContext, groupBy, filter, orderby, shouldIncludeResults, queryRunSummaryForInProgress) { return __awaiter(this, void 0, void 0, function* () { + if (releaseId == null) { + throw new TypeError('releaseId can not be null or undefined'); + } + if (releaseEnvId == null) { + throw new TypeError('releaseEnvId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project + }; let queryValues = { - '$queryOption': queryOption, + releaseId: releaseId, + releaseEnvId: releaseEnvId, + publishContext: publishContext, + groupBy: groupBy, + '$filter': filter, + '$orderby': orderby, + shouldIncludeResults: shouldIncludeResults, + queryRunSummaryForInProgress: queryRunSummaryForInProgress, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "def3d688-ddf5-4096-9024-69beea15cdbd", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "19a8183a-69fb-47d7-bfbf-1b6b0d921294", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.AccountMyWorkResult, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsDetails, false); resolve(ret); } catch (err) { @@ -33281,20 +34638,24 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets recent work item activities - * + * @param {Contracts.TestResultDocument} document + * @param {string} project - Project ID or project name + * @param {number} runId */ - getRecentActivityData() { + publishTestResultDocument(document, project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + runId: runId + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "1bc988f4-c15f-4072-ad35-497c87e3a909", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "74838649-b038-42f1-a0e7-6deb3973bf14", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.AccountRecentActivityWorkItemModel2, true); + res = yield this.rest.create(url, document, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -33304,20 +34665,37 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * INTERNAL ONLY: USED BY ACCOUNT MY WORK PAGE. - * + * @param {string} project - Project ID or project name + * @param {number} buildId + * @param {string} publishContext + * @param {string[]} fields + * @param {string} continuationToken */ - getRecentMentions() { + getResultGroupsByBuild(project, buildId, publishContext, fields, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } + if (publishContext == null) { + throw new TypeError('publishContext can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project + }; + let queryValues = { + buildId: buildId, + publishContext: publishContext, + fields: fields && fields.join(","), + continuationToken: continuationToken, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "d60eeb6e-e18c-4478-9e94-a0094e28f41c", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "e49244d1-c49f-49ad-a717-3bbaefe6a201", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.AccountRecentMentionWorkItemModel, true); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -33327,15 +34705,34 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get the list of work item tracking outbound artifact link types. - * + * @param {string} project - Project ID or project name + * @param {number} releaseId + * @param {string} publishContext + * @param {number} releaseEnvId + * @param {string[]} fields + * @param {string} continuationToken */ - getWorkArtifactLinkTypes() { + getResultGroupsByRelease(project, releaseId, publishContext, releaseEnvId, fields, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (releaseId == null) { + throw new TypeError('releaseId can not be null or undefined'); + } + if (publishContext == null) { + throw new TypeError('publishContext can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project + }; + let queryValues = { + releaseId: releaseId, + publishContext: publishContext, + releaseEnvId: releaseEnvId, + fields: fields && fields.join(","), + continuationToken: continuationToken, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "1a31de40-e318-41cd-a6c6-881077df52e3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "3c2b6bb0-0620-434a-a5c3-26aa0fcfda15", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -33350,24 +34747,28 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Queries work items linked to a given list of artifact URI. + * Get list of test Result meta data details for corresponding testcasereferenceId * - * @param {WorkItemTrackingInterfaces.ArtifactUriQuery} artifactUriQuery - Defines a list of artifact URI for querying work items. + * @param {string[]} testCaseReferenceIds - TestCaseReference Ids of the test Result to be queried, comma separated list of valid ids (limit no. of ids 200). * @param {string} project - Project ID or project name + * @param {Contracts.ResultMetaDataDetails} detailsToInclude - Details to include with test results metadata. Default is None. Other values are FlakyIdentifiers. */ - queryWorkItemsForArtifactUris(artifactUriQuery, project) { + queryTestResultsMetaData(testCaseReferenceIds, project, detailsToInclude) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + detailsToInclude: detailsToInclude, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "a9a9aa7a-8c09-44d3-ad1b-46e855c1e3d3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "testresults", "b72ff4c0-4341-4213-ba27-f517cf341c95", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, artifactUriQuery, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, testCaseReferenceIds, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -33377,34 +34778,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Uploads an attachment. + * Update properties of test result meta data * - * @param {NodeJS.ReadableStream} contentStream - Content to upload - * @param {string} fileName - The name of the file - * @param {string} uploadType - Attachment upload type: Simple or Chunked + * @param {Contracts.TestResultMetaDataUpdateInput} testResultMetaDataUpdateInput - TestResultMetaData update input TestResultMetaDataUpdateInput * @param {string} project - Project ID or project name - * @param {string} areaPath - Target project Area Path + * @param {number} testCaseReferenceId - TestCaseReference Id of Test Result to be updated. */ - createAttachment(customHeaders, contentStream, fileName, uploadType, project, areaPath) { + updateTestResultsMetaData(testResultMetaDataUpdateInput, project, testCaseReferenceId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - fileName: fileName, - uploadType: uploadType, - areaPath: areaPath, + project: project, + testCaseReferenceId: testCaseReferenceId }; - customHeaders = customHeaders || {}; - customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "e07b5fa4-1499-494d-a496-64b860fd64ff", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.4", "testresults", "b72ff4c0-4341-4213-ba27-f517cf341c95", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); - options.additionalHeaders = customHeaders; let res; - res = yield this.rest.uploadStream("POST", url, contentStream, options); + res = yield this.rest.update(url, testResultMetaDataUpdateInput, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -33415,30 +34807,23 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Downloads an attachment. - * - * @param {string} id - Attachment ID - * @param {string} fileName - Name of the file + * @param {Contracts.TestResultsQuery} query * @param {string} project - Project ID or project name - * @param {boolean} download - If set to true always download attachment */ - getAttachmentContent(id, fileName, project, download) { + getTestResultsByQuery(query, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - id: id - }; - let queryValues = { - fileName: fileName, - download: download, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "e07b5fa4-1499-494d-a496-64b860fd64ff", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "14033a2c-af25-4af1-9e39-8ef6900482e3", routeValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/octet-stream", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, query, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsQuery, false); + resolve(ret); } catch (err) { reject(err); @@ -33447,30 +34832,33 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Downloads an attachment. - * - * @param {string} id - Attachment ID - * @param {string} fileName - Name of the file + * @param {Contracts.QueryModel} queryModel * @param {string} project - Project ID or project name - * @param {boolean} download - If set to true always download attachment + * @param {boolean} includeResultDetails + * @param {boolean} includeIterationDetails + * @param {number} skip + * @param {number} top */ - getAttachmentZip(id, fileName, project, download) { + getTestResultsByQueryWiql(queryModel, project, includeResultDetails, includeIterationDetails, skip, top) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - id: id + project: project }; let queryValues = { - fileName: fileName, - download: download, + includeResultDetails: includeResultDetails, + includeIterationDetails: includeIterationDetails, + '$skip': skip, + '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "e07b5fa4-1499-494d-a496-64b860fd64ff", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "5ea78be3-2f5a-4110-8034-c27f24c62db1", routeValues, queryValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("application/zip", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, queryModel, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true); + resolve(ret); } catch (err) { reject(err); @@ -33479,34 +34867,24 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets root classification nodes or list of classification nodes for a given list of nodes ids, for a given project. In case ids parameter is supplied you will get list of classification nodes for those ids. Otherwise you will get root classification nodes for this project. - * + * @param {Contracts.TestCaseResult[]} results * @param {string} project - Project ID or project name - * @param {number[]} ids - Comma separated integer classification nodes ids. It's not required, if you want root nodes. - * @param {number} depth - Depth of children to fetch. - * @param {WorkItemTrackingInterfaces.ClassificationNodesErrorPolicy} errorPolicy - Flag to handle errors in getting some nodes. Possible options are Fail and Omit. + * @param {number} runId */ - getClassificationNodes(project, ids, depth, errorPolicy) { + addTestResultsToTestRun(results, project, runId) { return __awaiter(this, void 0, void 0, function* () { - if (ids == null) { - throw new TypeError('ids can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - ids: ids && ids.join(","), - '$depth': depth, - errorPolicy: errorPolicy, + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "a70579d1-f53a-48ee-a5be-7be8659023b9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "02afa165-e79a-4d70-8f0c-2af0f35b4e07", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, true); + res = yield this.rest.create(url, results, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -33516,27 +34894,29 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets root classification nodes under the project. - * * @param {string} project - Project ID or project name - * @param {number} depth - Depth of children to fetch. + * @param {number} runId + * @param {number} testResultId + * @param {Contracts.ResultDetails} detailsToInclude */ - getRootNodes(project, depth) { + getTestResultById(project, runId, testResultId, detailsToInclude) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId, + testResultId: testResultId }; let queryValues = { - '$depth': depth, + detailsToInclude: detailsToInclude, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "a70579d1-f53a-48ee-a5be-7be8659023b9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "02afa165-e79a-4d70-8f0c-2af0f35b4e07", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, true); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, false); resolve(ret); } catch (err) { @@ -33546,28 +34926,35 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Create new or update an existing classification node. - * - * @param {WorkItemTrackingInterfaces.WorkItemClassificationNode} postedNode - Node to create or update. * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - Structure group of the classification node, area or iteration. - * @param {string} path - Path of the classification node. + * @param {number} runId + * @param {Contracts.ResultDetails} detailsToInclude + * @param {number} skip + * @param {number} top + * @param {Contracts.TestOutcome[]} outcomes + * @param {boolean} newTestsOnly */ - createOrUpdateClassificationNode(postedNode, project, structureGroup, path) { + getTestResults(project, runId, detailsToInclude, skip, top, outcomes, newTestsOnly) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - structureGroup: structureGroup, - path: path + runId: runId + }; + let queryValues = { + detailsToInclude: detailsToInclude, + '$skip': skip, + '$top': top, + outcomes: outcomes && outcomes.join(","), + '$newTestsOnly': newTestsOnly, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "02afa165-e79a-4d70-8f0c-2af0f35b4e07", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, postedNode, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -33577,31 +34964,24 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Delete an existing classification node. - * + * @param {Contracts.TestCaseResult[]} results * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - Structure group of the classification node, area or iteration. - * @param {string} path - Path of the classification node. - * @param {number} reclassifyId - Id of the target classification node for reclassification. + * @param {number} runId */ - deleteClassificationNode(project, structureGroup, path, reclassifyId) { + updateTestResults(results, project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - structureGroup: structureGroup, - path: path - }; - let queryValues = { - '$reclassifyId': reclassifyId, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "02afa165-e79a-4d70-8f0c-2af0f35b4e07", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, results, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -33611,31 +34991,36 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets the classification node for a given node path. - * * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - Structure group of the classification node, area or iteration. - * @param {string} path - Path of the classification node. - * @param {number} depth - Depth of children to fetch. + * @param {number} buildId + * @param {string} publishContext + * @param {Contracts.TestOutcome[]} outcomes + * @param {number} top + * @param {string} continuationToken */ - getClassificationNode(project, structureGroup, path, depth) { + getTestResultsByBuild(project, buildId, publishContext, outcomes, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - structureGroup: structureGroup, - path: path + project: project }; let queryValues = { - '$depth': depth, + buildId: buildId, + publishContext: publishContext, + outcomes: outcomes && outcomes.join(","), + '$top': top, + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "f48cc885-dbc4-4efc-ab19-ae8c19d1e02a", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -33645,28 +35030,46 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Update an existing classification node. + * Get a list of results. * - * @param {WorkItemTrackingInterfaces.WorkItemClassificationNode} postedNode - Node to create or update. * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - Structure group of the classification node, area or iteration. - * @param {string} path - Path of the classification node. + * @param {number} pipelineId - Pipeline Id. This is same as build Id. + * @param {string} stageName - Name of the stage. Maximum supported length for name is 256 character. + * @param {string} phaseName - Name of the phase. Maximum supported length for name is 256 character. + * @param {string} jobName - Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + * @param {Contracts.TestOutcome[]} outcomes - List of outcome of results + * @param {boolean} includeAllBuildRuns - Whether to include Test Runs from from all the build runs or not. + * @param {number} top - Maximum number of results to return + * @param {String} continuationToken - Header to pass the continuationToken */ - updateClassificationNode(postedNode, project, structureGroup, path) { + getTestResultsByPipeline(customHeaders, project, pipelineId, stageName, phaseName, jobName, outcomes, includeAllBuildRuns, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (pipelineId == null) { + throw new TypeError('pipelineId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - structureGroup: structureGroup, - path: path + project: project + }; + let queryValues = { + pipelineId: pipelineId, + stageName: stageName, + phaseName: phaseName, + jobName: jobName, + outcomes: outcomes && outcomes.join(","), + includeAllBuildRuns: includeAllBuildRuns, + '$top': top, }; + customHeaders = customHeaders || {}; + customHeaders["x-ms-continuationtoken"] = "continuationToken"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "80169dc2-30c3-4c25-84b2-dd67d7ff1f52", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.update(url, postedNode, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -33676,30 +35079,33 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get users who reacted on the comment. - * * @param {string} project - Project ID or project name - * @param {number} workItemId - WorkItem ID. - * @param {number} commentId - Comment ID. - * @param {WorkItemTrackingInterfaces.CommentReactionType} reactionType - Type of the reaction. + * @param {number} releaseId + * @param {number} releaseEnvid + * @param {string} publishContext + * @param {Contracts.TestOutcome[]} outcomes * @param {number} top - * @param {number} skip + * @param {string} continuationToken */ - getEngagedUsers(project, workItemId, commentId, reactionType, top, skip) { + getTestResultsByRelease(project, releaseId, releaseEnvid, publishContext, outcomes, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (releaseId == null) { + throw new TypeError('releaseId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - workItemId: workItemId, - commentId: commentId, - reactionType: reactionType + project: project }; let queryValues = { + releaseId: releaseId, + releaseEnvid: releaseEnvid, + publishContext: publishContext, + outcomes: outcomes && outcomes.join(","), '$top': top, - '$skip': skip, + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "e33ca5e0-2349-4285-af3d-d72d86781c35", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "3994b949-77e5-495d-8034-edf80d95b84e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -33714,26 +35120,40 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Add a comment on a work item. + * Get all the available groups details and for these groups get failed and aborted results. * - * @param {WorkItemTrackingInterfaces.CommentCreate} request - Comment create request. * @param {string} project - Project ID or project name - * @param {number} workItemId - Id of a work item. + * @param {number} pipelineId - Pipeline Id. This is same as build Id. + * @param {string} stageName - Name of the stage. Maximum supported length for name is 256 character. + * @param {string} phaseName - Name of the phase. Maximum supported length for name is 256 character. + * @param {string} jobName - Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + * @param {boolean} shouldIncludeFailedAndAbortedResults - If true, it will return Ids of failed and aborted results for each test group + * @param {boolean} queryGroupSummaryForInProgress - If true, it will calculate summary for InProgress runs as well. */ - addComment(request, project, workItemId) { + testResultsGroupDetails(project, pipelineId, stageName, phaseName, jobName, shouldIncludeFailedAndAbortedResults, queryGroupSummaryForInProgress) { return __awaiter(this, void 0, void 0, function* () { + if (pipelineId == null) { + throw new TypeError('pipelineId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - workItemId: workItemId + project: project + }; + let queryValues = { + pipelineId: pipelineId, + stageName: stageName, + phaseName: phaseName, + jobName: jobName, + shouldIncludeFailedAndAbortedResults: shouldIncludeFailedAndAbortedResults, + queryGroupSummaryForInProgress: queryGroupSummaryForInProgress, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "f903b850-06af-4b50-a344-d7bbfb19e93b", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, request, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.Comment, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsDetails, false); resolve(ret); } catch (err) { @@ -33743,27 +35163,34 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Delete a comment on a work item. - * * @param {string} project - Project ID or project name - * @param {number} workItemId - Id of a work item. - * @param {number} commentId + * @param {number} buildId + * @param {string} publishContext + * @param {boolean} includeFailureDetails + * @param {Contracts.BuildReference} buildToCompare */ - deleteComment(project, workItemId, commentId) { + queryTestResultsReportForBuild(project, buildId, publishContext, includeFailureDetails, buildToCompare) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - workItemId: workItemId, - commentId: commentId + project: project + }; + let queryValues = { + buildId: buildId, + publishContext: publishContext, + includeFailureDetails: includeFailureDetails, + buildToCompare: buildToCompare, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "e009fa95-95a5-4ad4-9681-590043ce2423", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultSummary, false); resolve(ret); } catch (err) { @@ -33773,33 +35200,38 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns a work item comment. + * Get summary of test results. * * @param {string} project - Project ID or project name - * @param {number} workItemId - Id of a work item to get the comment. - * @param {number} commentId - Id of the comment to return. - * @param {boolean} includeDeleted - Specify if the deleted comment should be retrieved. - * @param {WorkItemTrackingInterfaces.CommentExpandOptions} expand - Specifies the additional data retrieval options for work item comments. + * @param {number} pipelineId - Pipeline Id. This is same as build Id. + * @param {string} stageName - Name of the stage. Maximum supported length for name is 256 character. + * @param {string} phaseName - Name of the phase. Maximum supported length for name is 256 character. + * @param {string} jobName - Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + * @param {boolean} includeFailureDetails - If true returns failure insights */ - getComment(project, workItemId, commentId, includeDeleted, expand) { + queryTestResultsReportForPipeline(project, pipelineId, stageName, phaseName, jobName, includeFailureDetails) { return __awaiter(this, void 0, void 0, function* () { + if (pipelineId == null) { + throw new TypeError('pipelineId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - workItemId: workItemId, - commentId: commentId + project: project }; let queryValues = { - includeDeleted: includeDeleted, - '$expand': expand, + pipelineId: pipelineId, + stageName: stageName, + phaseName: phaseName, + jobName: jobName, + includeFailureDetails: includeFailureDetails, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "71f746a1-7d68-40fe-b705-9d821a73dff2", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.Comment, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultSummary, false); resolve(ret); } catch (err) { @@ -33809,37 +35241,39 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns a list of work item comments, pageable. - * * @param {string} project - Project ID or project name - * @param {number} workItemId - Id of a work item to get comments for. - * @param {number} top - Max number of comments to return. - * @param {string} continuationToken - Used to query for the next page of comments. - * @param {boolean} includeDeleted - Specify if the deleted comments should be retrieved. - * @param {WorkItemTrackingInterfaces.CommentExpandOptions} expand - Specifies the additional data retrieval options for work item comments. - * @param {WorkItemTrackingInterfaces.CommentSortOrder} order - Order in which the comments should be returned. + * @param {number} releaseId + * @param {number} releaseEnvId + * @param {string} publishContext + * @param {boolean} includeFailureDetails + * @param {Contracts.ReleaseReference} releaseToCompare */ - getComments(project, workItemId, top, continuationToken, includeDeleted, expand, order) { + queryTestResultsReportForRelease(project, releaseId, releaseEnvId, publishContext, includeFailureDetails, releaseToCompare) { return __awaiter(this, void 0, void 0, function* () { + if (releaseId == null) { + throw new TypeError('releaseId can not be null or undefined'); + } + if (releaseEnvId == null) { + throw new TypeError('releaseEnvId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - workItemId: workItemId + project: project }; let queryValues = { - '$top': top, - continuationToken: continuationToken, - includeDeleted: includeDeleted, - '$expand': expand, - order: order, + releaseId: releaseId, + releaseEnvId: releaseEnvId, + publishContext: publishContext, + includeFailureDetails: includeFailureDetails, + releaseToCompare: releaseToCompare, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "f10f9577-2c04-45ab-8c99-b26567a7cd55", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentList, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultSummary, false); resolve(ret); } catch (err) { @@ -33849,36 +35283,22 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns a list of work item comments by ids. - * + * @param {Contracts.ReleaseReference[]} releases * @param {string} project - Project ID or project name - * @param {number} workItemId - Id of a work item to get comments for. - * @param {number[]} ids - Comma-separated list of comment ids to return. - * @param {boolean} includeDeleted - Specify if the deleted comments should be retrieved. - * @param {WorkItemTrackingInterfaces.CommentExpandOptions} expand - Specifies the additional data retrieval options for work item comments. */ - getCommentsBatch(project, workItemId, ids, includeDeleted, expand) { + queryTestResultsSummaryForReleases(releases, project) { return __awaiter(this, void 0, void 0, function* () { - if (ids == null) { - throw new TypeError('ids can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - workItemId: workItemId - }; - let queryValues = { - ids: ids && ids.join(","), - includeDeleted: includeDeleted, - '$expand': expand, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "f10f9577-2c04-45ab-8c99-b26567a7cd55", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentList, false); + res = yield this.rest.create(url, releases, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultSummary, true); resolve(ret); } catch (err) { @@ -33888,28 +35308,26 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Update a comment on a work item. - * - * @param {WorkItemTrackingInterfaces.CommentUpdate} request - Comment update request. + * @param {Contracts.TestResultsContext} resultsContext * @param {string} project - Project ID or project name - * @param {number} workItemId - Id of a work item. - * @param {number} commentId + * @param {number[]} workItemIds */ - updateComment(request, project, workItemId, commentId) { + queryTestSummaryByRequirement(resultsContext, project, workItemIds) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - workItemId: workItemId, - commentId: commentId + project: project + }; + let queryValues = { + workItemIds: workItemIds && workItemIds.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "3b7fd26f-c335-4e55-afc1-a588f5e2af3c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, request, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.Comment, false); + res = yield this.rest.create(url, resultsContext, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestSummaryForWorkItem, true); resolve(ret); } catch (err) { @@ -33919,29 +35337,22 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Adds a new reaction to a comment. - * + * @param {Contracts.TestResultTrendFilter} filter * @param {string} project - Project ID or project name - * @param {number} workItemId - WorkItem ID - * @param {number} commentId - Comment ID - * @param {WorkItemTrackingInterfaces.CommentReactionType} reactionType - Type of the reaction */ - createCommentReaction(project, workItemId, commentId, reactionType) { + queryResultTrendForBuild(filter, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - workItemId: workItemId, - commentId: commentId, - reactionType: reactionType + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "f6cb3f27-1028-4851-af96-887e570dc21f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "0886a7ae-315a-4dba-9122-bcce93301f3a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, null, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentReaction, false); + res = yield this.rest.create(url, filter, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.AggregatedDataForResultTrend, true); resolve(ret); } catch (err) { @@ -33951,29 +35362,22 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Deletes an existing reaction on a comment. - * + * @param {Contracts.TestResultTrendFilter} filter * @param {string} project - Project ID or project name - * @param {number} workItemId - WorkItem ID - * @param {number} commentId - Comment ID - * @param {WorkItemTrackingInterfaces.CommentReactionType} reactionType - Type of the reaction */ - deleteCommentReaction(project, workItemId, commentId, reactionType) { + queryResultTrendForRelease(filter, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - workItemId: workItemId, - commentId: commentId, - reactionType: reactionType + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "f6cb3f27-1028-4851-af96-887e570dc21f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "107f23c3-359a-460a-a70c-63ee739f9f9a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentReaction, false); + res = yield this.rest.create(url, filter, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.AggregatedDataForResultTrend, true); resolve(ret); } catch (err) { @@ -33983,27 +35387,22 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets reactions of a comment. - * + * @param {Contracts.RunCreateModel} testRun * @param {string} project - Project ID or project name - * @param {number} workItemId - WorkItem ID - * @param {number} commentId - Comment ID */ - getCommentReactions(project, workItemId, commentId) { + createTestRun(testRun, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - workItemId: workItemId, - commentId: commentId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "f6cb3f27-1028-4851-af96-887e570dc21f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentReaction, true); + res = yield this.rest.create(url, testRun, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRun, false); resolve(ret); } catch (err) { @@ -34014,26 +35413,22 @@ class WorkItemTrackingApi extends basem.ClientApiBase { } /** * @param {string} project - Project ID or project name - * @param {number} workItemId - * @param {number} commentId - * @param {number} version + * @param {number} runId */ - getCommentVersion(project, workItemId, commentId, version) { + deleteTestRun(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - workItemId: workItemId, - commentId: commentId, - version: version + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "49e03b34-3be0-42e3-8a5d-e8dfb88ac954", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentVersion, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -34044,24 +35439,28 @@ class WorkItemTrackingApi extends basem.ClientApiBase { } /** * @param {string} project - Project ID or project name - * @param {number} workItemId - * @param {number} commentId + * @param {number} runId + * @param {boolean} includeDetails + * @param {boolean} includeTags */ - getCommentVersions(project, workItemId, commentId) { + getTestRunById(project, runId, includeDetails, includeTags) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - workItemId: workItemId, - commentId: commentId + runId: runId + }; + let queryValues = { + includeDetails: includeDetails, + includeTags: includeTags, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "49e03b34-3be0-42e3-8a5d-e8dfb88ac954", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentVersion, true); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRun, false); resolve(ret); } catch (err) { @@ -34071,24 +35470,39 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Create a new field. - * - * @param {WorkItemTrackingInterfaces.WorkItemField} workItemField - New field definition * @param {string} project - Project ID or project name + * @param {string} buildUri + * @param {string} owner + * @param {string} tmiRunId + * @param {number} planId + * @param {boolean} includeRunDetails + * @param {boolean} automated + * @param {number} skip + * @param {number} top */ - createField(workItemField, project) { + getTestRuns(project, buildUri, owner, tmiRunId, planId, includeRunDetails, automated, skip, top) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + buildUri: buildUri, + owner: owner, + tmiRunId: tmiRunId, + planId: planId, + includeRunDetails: includeRunDetails, + automated: automated, + '$skip': skip, + '$top': top, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, workItemField, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRun, true); resolve(ret); } catch (err) { @@ -34098,25 +35512,63 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Deletes the field. To undelete a filed, see "Update Field" API. + * Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate. * - * @param {string} fieldNameOrRefName - Field simple name or reference name * @param {string} project - Project ID or project name + * @param {Date} minLastUpdatedDate - Minimum Last Modified Date of run to be queried (Mandatory). + * @param {Date} maxLastUpdatedDate - Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days). + * @param {Contracts.TestRunState} state - Current state of the Runs to be queried. + * @param {number[]} planIds - Plan Ids of the Runs to be queried, comma separated list of valid ids. + * @param {boolean} isAutomated - Automation type of the Runs to be queried. + * @param {Contracts.TestRunPublishContext} publishContext - PublishContext of the Runs to be queried. + * @param {number[]} buildIds - Build Ids of the Runs to be queried, comma separated list of valid ids. + * @param {number[]} buildDefIds - Build Definition Ids of the Runs to be queried, comma separated list of valid ids. + * @param {string} branchName - Source Branch name of the Runs to be queried. + * @param {number[]} releaseIds - Release Ids of the Runs to be queried, comma separated list of valid ids. + * @param {number[]} releaseDefIds - Release Definition Ids of the Runs to be queried, comma separated list of valid ids. + * @param {number[]} releaseEnvIds - Release Environment Ids of the Runs to be queried, comma separated list of valid ids. + * @param {number[]} releaseEnvDefIds - Release Environment Definition Ids of the Runs to be queried, comma separated list of valid ids. + * @param {string} runTitle - Run Title of the Runs to be queried. + * @param {number} top - Number of runs to be queried. Limit is 100 + * @param {string} continuationToken - continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user. */ - deleteField(fieldNameOrRefName, project) { + queryTestRuns(project, minLastUpdatedDate, maxLastUpdatedDate, state, planIds, isAutomated, publishContext, buildIds, buildDefIds, branchName, releaseIds, releaseDefIds, releaseEnvIds, releaseEnvDefIds, runTitle, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (minLastUpdatedDate == null) { + throw new TypeError('minLastUpdatedDate can not be null or undefined'); + } + if (maxLastUpdatedDate == null) { + throw new TypeError('maxLastUpdatedDate can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - fieldNameOrRefName: fieldNameOrRefName + project: project + }; + let queryValues = { + minLastUpdatedDate: minLastUpdatedDate, + maxLastUpdatedDate: maxLastUpdatedDate, + state: state, + planIds: planIds && planIds.join(","), + isAutomated: isAutomated, + publishContext: publishContext, + buildIds: buildIds && buildIds.join(","), + buildDefIds: buildDefIds && buildDefIds.join(","), + branchName: branchName, + releaseIds: releaseIds && releaseIds.join(","), + releaseDefIds: releaseDefIds && releaseDefIds.join(","), + releaseEnvIds: releaseEnvIds && releaseEnvIds.join(","), + releaseEnvDefIds: releaseEnvDefIds && releaseEnvDefIds.join(","), + runTitle: runTitle, + '$top': top, + continuationToken: continuationToken, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRun, true); resolve(ret); } catch (err) { @@ -34126,25 +35578,24 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets information on a specific field. - * - * @param {string} fieldNameOrRefName - Field simple name or reference name + * @param {Contracts.RunUpdateModel} runUpdateModel * @param {string} project - Project ID or project name + * @param {number} runId */ - getField(fieldNameOrRefName, project) { + updateTestRun(runUpdateModel, project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - fieldNameOrRefName: fieldNameOrRefName + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "364538f9-8062-4ce0-b024-75a0fb463f0d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, false); + res = yield this.rest.update(url, runUpdateModel, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRun, false); resolve(ret); } catch (err) { @@ -34154,27 +35605,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns information for all fields. The project ID/name parameter is optional. + * Get test run summary, used when we want to get summary of a run by outcome. Test run should be in completed state. * * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.GetFieldsExpand} expand - Use ExtensionFields to include extension fields, otherwise exclude them. Unless the feature flag for this parameter is enabled, extension fields are always included. + * @param {number} runId - ID of the run to get. */ - getFields(project, expand) { + getTestRunSummaryByOutcome(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - '$expand': expand, + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "5c6a250c-53b7-4851-990c-42a7a00c8b39", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, true); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRunStatistic, false); resolve(ret); } catch (err) { @@ -34184,26 +35633,27 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Update a field. + * Get TestResultsSettings data * - * @param {WorkItemTrackingInterfaces.UpdateWorkItemField} payload - Payload contains desired value of the field's properties - * @param {string} fieldNameOrRefName - Name/reference name of the field to be updated * @param {string} project - Project ID or project name + * @param {Contracts.TestResultsSettingsType} settingsType */ - updateField(payload, fieldNameOrRefName, project) { + getTestResultsSettings(project, settingsType) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - fieldNameOrRefName: fieldNameOrRefName + project: project + }; + let queryValues = { + settingsType: settingsType, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testresults", "7319952e-e5a9-4e19-a006-84f3be8b7c68", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, payload, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsSettings, false); resolve(ret); } catch (err) { @@ -34213,24 +35663,24 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Migrates a project to a different process within the same OOB type. For example, you can only migrate a project from agile/custom-agile to agile/custom-agile. + * Update project settings of test results * - * @param {WorkItemTrackingInterfaces.ProcessIdModel} newProcess + * @param {Contracts.TestResultsUpdateSettings} testResultsUpdateSettings * @param {string} project - Project ID or project name */ - migrateProjectsProcess(newProcess, project) { + updatePipelinesTestSettings(testResultsUpdateSettings, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "19801631-d4e5-47e9-8166-0330de0ff1e6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "testresults", "7319952e-e5a9-4e19-a006-84f3be8b7c68", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, newProcess, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, testResultsUpdateSettings, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsSettings, false); resolve(ret); } catch (err) { @@ -34240,30 +35690,40 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Creates a query, or moves a query. + * Gets the list of results whose failure matches with the provided one. * - * @param {WorkItemTrackingInterfaces.QueryHierarchyItem} postedQuery - The query to create. * @param {string} project - Project ID or project name - * @param {string} query - The parent id or path under which the query is to be created. - * @param {boolean} validateWiqlOnly - If you only want to validate your WIQL query without actually creating one, set it to true. Default is false. + * @param {number} runId - id of test run + * @param {number} testResultId - id of test result inside a test run + * @param {number} testSubResultId - id of subresult inside a test result + * @param {number} top - Maximum number of results to return + * @param {String} continuationToken - Header to pass the continuationToken */ - createQuery(postedQuery, project, query, validateWiqlOnly) { + getSimilarTestResults(customHeaders, project, runId, testResultId, testSubResultId, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (testSubResultId == null) { + throw new TypeError('testSubResultId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - query: query + runId: runId, + testResultId: testResultId }; let queryValues = { - validateWiqlOnly: validateWiqlOnly, + testSubResultId: testSubResultId, + '$top': top, }; + customHeaders = customHeaders || {}; + customHeaders["x-ms-continuationtoken"] = "continuationToken"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "67d0a074-b255-4902-a639-e3e6de7a3de6", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.create(url, postedQuery, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -34273,25 +35733,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Delete a query or a folder. This deletes any permission change on the deleted query or folder and any of its descendants if it is a folder. It is important to note that the deleted permission changes cannot be recovered upon undeleting the query or folder. + * Get test run statistics , used when we want to get summary of a run by outcome. * * @param {string} project - Project ID or project name - * @param {string} query - ID or path of the query or folder to delete. + * @param {number} runId - ID of the run to get. */ - deleteQuery(project, query) { + getTestRunStatistics(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - query: query + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "82b986e8-ca9e-4a89-b39e-f65c69bc104a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestRunStatistic, false); resolve(ret); } catch (err) { @@ -34301,31 +35761,31 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets the root queries and their children + *

Gets the coverage status for the last successful build of a definition, optionally scoped to a specific branch

* * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.QueryExpand} expand - Include the query string (wiql), clauses, query result columns, and sort options in the results. - * @param {number} depth - In the folder of queries, return child queries and folders to this depth. - * @param {boolean} includeDeleted - Include deleted queries and folders + * @param {string} definition - The ID or name of the definition. + * @param {string} branchName - The branch name. + * @param {string} label - The String to replace the default text on the left side of the badge. */ - getQueries(project, expand, depth, includeDeleted) { + getCoverageStatusBadge(project, definition, branchName, label) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + definition: definition }; let queryValues = { - '$expand': expand, - '$depth': depth, - '$includeDeleted': includeDeleted, + branchName: branchName, + label: label, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "73b7c9d8-defb-4b60-b3d6-2162d60d6b13", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, true); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -34335,33 +35795,30 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Retrieves an individual query and its children + * Get all the tags in a build. * * @param {string} project - Project ID or project name - * @param {string} query - ID or path of the query. - * @param {WorkItemTrackingInterfaces.QueryExpand} expand - Include the query string (wiql), clauses, query result columns, and sort options in the results. - * @param {number} depth - In the folder of queries, return child queries and folders to this depth. - * @param {boolean} includeDeleted - Include deleted queries and folders + * @param {number} buildId - Build ID */ - getQuery(project, query, expand, depth, includeDeleted) { + getTestTagsForBuild(project, buildId) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - query: query + project: project }; let queryValues = { - '$expand': expand, - '$depth': depth, - '$includeDeleted': includeDeleted, + buildId: buildId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "52ee2057-4b54-41a6-a18c-ed4375a00f8d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -34371,36 +35828,35 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Searches all queries the user has access to in the current project + * Get all the tags in a release. * * @param {string} project - Project ID or project name - * @param {string} filter - The text to filter the queries with. - * @param {number} top - The number of queries to return (Default is 50 and maximum is 200). - * @param {WorkItemTrackingInterfaces.QueryExpand} expand - * @param {boolean} includeDeleted - Include deleted queries and folders + * @param {number} releaseId - Release ID + * @param {number} releaseEnvId - Release environment ID */ - searchQueries(project, filter, top, expand, includeDeleted) { + getTestTagsForRelease(project, releaseId, releaseEnvId) { return __awaiter(this, void 0, void 0, function* () { - if (filter == null) { - throw new TypeError('filter can not be null or undefined'); + if (releaseId == null) { + throw new TypeError('releaseId can not be null or undefined'); + } + if (releaseEnvId == null) { + throw new TypeError('releaseEnvId can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; let queryValues = { - '$filter': filter, - '$top': top, - '$expand': expand, - '$includeDeleted': includeDeleted, + releaseId: releaseId, + releaseEnvId: releaseEnvId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "52ee2057-4b54-41a6-a18c-ed4375a00f8d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItemsResult, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -34410,30 +35866,26 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Update a query or a folder. This allows you to update, rename and move queries and folders. + * Update tags of a run, Tags can be Added and Deleted * - * @param {WorkItemTrackingInterfaces.QueryHierarchyItem} queryUpdate - The query to update. + * @param {Contracts.TestTagsUpdateModel} testTagsUpdateModel - TestTagsUpdateModel * @param {string} project - Project ID or project name - * @param {string} query - The ID or path for the query to update. - * @param {boolean} undeleteDescendants - Undelete the children of this folder. It is important to note that this will not bring back the permission changes that were previously applied to the descendants. + * @param {number} runId - RunId of the run */ - updateQuery(queryUpdate, project, query, undeleteDescendants) { + updateTestRunTags(testTagsUpdateModel, project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - query: query - }; - let queryValues = { - '$undeleteDescendants': undeleteDescendants, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "a5e2f411-2b43-45f3-989c-05b71339f5b8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, queryUpdate, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, false); + res = yield this.rest.update(url, testTagsUpdateModel, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -34443,24 +35895,30 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets a list of queries by ids (Maximum 1000) + * Get all the tags in a build. * - * @param {WorkItemTrackingInterfaces.QueryBatchGetRequest} queryGetRequest * @param {string} project - Project ID or project name + * @param {number} buildId - Build ID */ - getQueriesBatch(queryGetRequest, project) { + getTestTagSummaryForBuild(project, buildId) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + buildId: buildId, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "549816f9-09b0-4e75-9e81-01fbfcd07426", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "655a8f6b-fec7-4b46-b672-68b44141b498", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, queryGetRequest, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -34470,24 +35928,34 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Destroys the specified work item permanently from the Recycle Bin. This action can not be undone. + * Get all the tags in a release. * - * @param {number} id - ID of the work item to be destroyed permanently * @param {string} project - Project ID or project name + * @param {number} releaseId - Release ID + * @param {number} releaseEnvId - Release environment ID */ - destroyWorkItem(id, project) { + getTestTagSummaryForRelease(project, releaseId, releaseEnvId) { return __awaiter(this, void 0, void 0, function* () { + if (releaseId == null) { + throw new TypeError('releaseId can not be null or undefined'); + } + if (releaseEnvId == null) { + throw new TypeError('releaseEnvId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - id: id + project: project + }; + let queryValues = { + releaseId: releaseId, + releaseEnvId: releaseEnvId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "655a8f6b-fec7-4b46-b672-68b44141b498", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -34498,24 +35966,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets a deleted work item from Recycle Bin. + * Creates an attachment in the LogStore for the specified buildId. * - * @param {number} id - ID of the work item to be returned + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel - Contains attachment info like stream, filename, comment, attachmentType * @param {string} project - Project ID or project name + * @param {number} buildId - BuildId */ - getDeletedWorkItem(id, project) { + createBuildAttachmentInLogStore(attachmentRequestModel, project, buildId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id + buildId: buildId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "6f747e16-18c2-435a-b4fb-fa05d6845fee", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.create(url, attachmentRequestModel, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -34526,30 +35995,26 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets the work items from the recycle bin, whose IDs have been specified in the parameters + * Creates an attachment in the LogStore for the specified runId. * - * @param {number[]} ids - Comma separated list of IDs of the deleted work items to be returned + * @param {Contracts.TestAttachmentRequestModel} attachmentRequestModel - Contains attachment info like stream, filename, comment, attachmentType * @param {string} project - Project ID or project name + * @param {number} runId - Test RunId */ - getDeletedWorkItems(ids, project) { + createTestRunLogStoreAttachment(attachmentRequestModel, project, runId) { return __awaiter(this, void 0, void 0, function* () { - if (ids == null) { - throw new TypeError('ids can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - ids: ids && ids.join(","), + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "1026d5de-4b0b-46ae-a31f-7c59b6af51ef", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, attachmentRequestModel, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -34559,23 +36024,32 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets a list of the IDs and the URLs of the deleted the work items in the Recycle Bin. + * Deletes the attachment with the specified filename for the specified runId from the LogStore. * * @param {string} project - Project ID or project name + * @param {number} runId - Test RunId + * @param {string} filename - Attachment FileName */ - getDeletedWorkItemShallowReferences(project) { + deleteTestRunLogStoreAttachment(project, runId, filename) { return __awaiter(this, void 0, void 0, function* () { + if (filename == null) { + throw new TypeError('filename can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId + }; + let queryValues = { + filename: filename, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "1026d5de-4b0b-46ae-a31f-7c59b6af51ef", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -34585,27 +36059,31 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Restores the deleted work item from Recycle Bin. + * Returns the attachment with the specified filename for the specified runId from the LogStore. * - * @param {WorkItemTrackingInterfaces.WorkItemDeleteUpdate} payload - Paylod with instructions to update the IsDeleted flag to false - * @param {number} id - ID of the work item to be restored * @param {string} project - Project ID or project name + * @param {number} runId - Test RunId + * @param {string} filename - Attachment FileName */ - restoreWorkItem(payload, id, project) { + getTestRunLogStoreAttachmentContent(project, runId, filename) { return __awaiter(this, void 0, void 0, function* () { + if (filename == null) { + throw new TypeError('filename can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id + runId: runId + }; + let queryValues = { + filename: filename, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "1026d5de-4b0b-46ae-a31f-7c59b6af51ef", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.update(url, payload, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -34614,31 +36092,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns a fully hydrated work item for the requested revision + * Returns a list of attachments for the specified runId from the LogStore. * - * @param {number} id - * @param {number} revisionNumber - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand * @param {string} project - Project ID or project name + * @param {number} runId - Test RunId */ - getRevision(id, revisionNumber, expand, project) { + getTestRunLogStoreAttachments(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id, - revisionNumber: revisionNumber - }; - let queryValues = { - '$expand': expand, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "a00c85a5-80fa-4565-99c3-bcd2181434bb", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "1026d5de-4b0b-46ae-a31f-7c59b6af51ef", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreAttachment, true); resolve(ret); } catch (err) { @@ -34648,34 +36120,31 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns the list of fully hydrated work item revisions, paged. + * Returns the attachment with the specified filename for the specified runId from the LogStore. * - * @param {number} id - * @param {number} top - * @param {number} skip - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand * @param {string} project - Project ID or project name + * @param {number} runId - Test RunId + * @param {string} filename - Attachment FileName */ - getRevisions(id, top, skip, expand, project) { + getTestRunLogStoreAttachmentZip(project, runId, filename) { return __awaiter(this, void 0, void 0, function* () { + if (filename == null) { + throw new TypeError('filename can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id + runId: runId }; let queryValues = { - '$top': top, - '$skip': skip, - '$expand': expand, + filename: filename, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "a00c85a5-80fa-4565-99c3-bcd2181434bb", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "1026d5de-4b0b-46ae-a31f-7c59b6af51ef", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -34684,23 +36153,23 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * RESTful method to send mail for selected/queried work items. + * Creates a new test failure type * - * @param {WorkItemTrackingInterfaces.SendMailBody} body + * @param {Contracts.TestResultFailureTypeRequestModel} testResultFailureType * @param {string} project - Project ID or project name */ - sendMail(body, project) { + createFailureType(testResultFailureType, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "12438500-2f84-4fa7-9f1a-c31871b4959d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "c4ac0486-830c-4a2a-9ef9-e8a1791a70fd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, body, options); + res = yield this.rest.create(url, testResultFailureType, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -34711,18 +36180,20 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** + * Deletes a test failure type with specified failureTypeId + * * @param {string} project - Project ID or project name - * @param {string} tagIdOrName + * @param {number} failureTypeId */ - deleteTag(project, tagIdOrName) { + deleteFailureType(project, failureTypeId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - tagIdOrName: tagIdOrName + failureTypeId: failureTypeId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "c4ac0486-830c-4a2a-9ef9-e8a1791a70fd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -34737,23 +36208,23 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** + * Returns the list of test failure types. + * * @param {string} project - Project ID or project name - * @param {string} tagIdOrName */ - getTag(project, tagIdOrName) { + getFailureTypes(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - tagIdOrName: tagIdOrName + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "c4ac0486-830c-4a2a-9ef9-e8a1791a70fd", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -34763,21 +36234,24 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** + * Get history of a test method using TestHistoryQuery + * + * @param {Contracts.TestHistoryQuery} filter - TestHistoryQuery to get history * @param {string} project - Project ID or project name */ - getTags(project) { + queryTestHistory(filter, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "2a41bd6a-8118-4403-b74e-5ba7492aed9d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, filter, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestHistoryQuery, false); resolve(ret); } catch (err) { @@ -34787,24 +36261,47 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * @param {WorkItemTrackingInterfaces.WorkItemTagDefinition} tagData + * Get list of build attachments reference + * * @param {string} project - Project ID or project name - * @param {string} tagIdOrName + * @param {number} buildId - Id of the build to get + * @param {Contracts.TestLogType} type - type of the attachment to get + * @param {string} directoryPath - directory path for which attachments are needed + * @param {string} fileNamePrefix - file name prefix to filter the list of attachment + * @param {boolean} fetchMetaData - Default is false, set if metadata is needed + * @param {number} top - Number of test attachments reference to return + * @param {String} continuationToken - Header to pass the continuationToken */ - updateTag(tagData, project, tagIdOrName) { + getTestLogsForBuild(customHeaders, project, buildId, type, directoryPath, fileNamePrefix, fetchMetaData, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } + if (type == null) { + throw new TypeError('type can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - tagIdOrName: tagIdOrName + project: project + }; + let queryValues = { + buildId: buildId, + type: type, + directoryPath: directoryPath, + fileNamePrefix: fileNamePrefix, + fetchMetaData: fetchMetaData, + top: top, }; + customHeaders = customHeaders || {}; + customHeaders["x-ms-continuationtoken"] = "continuationToken"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "dff8ce3a-e539-4817-a405-d968491a88f1", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.update(url, tagData, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLog, true); resolve(ret); } catch (err) { @@ -34814,31 +36311,46 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Creates a template + * Get list of test result attachments reference * - * @param {WorkItemTrackingInterfaces.WorkItemTemplate} template - Template contents - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} project - Project ID or project name + * @param {number} runId - Id of the test run that contains the result + * @param {number} resultId - Id of the test result + * @param {Contracts.TestLogType} type - type of attachments to get + * @param {string} directoryPath - directory path of attachments to get + * @param {string} fileNamePrefix - file name prefix to filter the list of attachment + * @param {boolean} fetchMetaData - Default is false, set if metadata is needed + * @param {number} top - Numbe of attachments reference to return + * @param {String} continuationToken - Header to pass the continuationToken */ - createTemplate(template, teamContext) { + getTestResultLogs(customHeaders, project, runId, resultId, type, directoryPath, fileNamePrefix, fetchMetaData, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (type == null) { + throw new TypeError('type can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + runId: runId, + resultId: resultId + }; + let queryValues = { + type: type, + directoryPath: directoryPath, + fileNamePrefix: fileNamePrefix, + fetchMetaData: fetchMetaData, + top: top, }; + customHeaders = customHeaders || {}; + customHeaders["x-ms-continuationtoken"] = "continuationToken"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "6a90345f-a676-4969-afce-8e163e1d5642", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "714caaac-ae1e-4869-8323-9bc0f5120dbf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.create(url, template, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLog, true); resolve(ret); } catch (err) { @@ -34848,34 +36360,51 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets template + * Get list of test subresult attachments reference * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} workitemtypename - Optional, When specified returns templates for given Work item type. + * @param {string} project - Project ID or project name + * @param {number} runId - Id of the test run that contains the results + * @param {number} resultId - Id of the test result that contains subresult + * @param {number} subResultId - Id of the test subresult + * @param {Contracts.TestLogType} type - type of the attachments to get + * @param {string} directoryPath - directory path of the attachment to get + * @param {string} fileNamePrefix - file name prefix to filter the list of attachments + * @param {boolean} fetchMetaData - Default is false, set if metadata is needed + * @param {number} top - Number of attachments reference to return + * @param {String} continuationToken - Header to pass the continuationToken */ - getTemplates(teamContext, workitemtypename) { + getTestSubResultLogs(customHeaders, project, runId, resultId, subResultId, type, directoryPath, fileNamePrefix, fetchMetaData, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (subResultId == null) { + throw new TypeError('subResultId can not be null or undefined'); + } + if (type == null) { + throw new TypeError('type can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + runId: runId, + resultId: resultId }; let queryValues = { - workitemtypename: workitemtypename, + subResultId: subResultId, + type: type, + directoryPath: directoryPath, + fileNamePrefix: fileNamePrefix, + fetchMetaData: fetchMetaData, + top: top, }; + customHeaders = customHeaders || {}; + customHeaders["x-ms-continuationtoken"] = "continuationToken"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "6a90345f-a676-4969-afce-8e163e1d5642", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "714caaac-ae1e-4869-8323-9bc0f5120dbf", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLog, true); resolve(ret); } catch (err) { @@ -34885,32 +36414,44 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Deletes the template with given id + * Get list of test run attachments reference * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} templateId - Template id + * @param {string} project - Project ID or project name + * @param {number} runId - Id of the test run + * @param {Contracts.TestLogType} type - type of the attachments to get + * @param {string} directoryPath - directory path for which attachments are needed + * @param {string} fileNamePrefix - file name prefix to filter the list of attachment + * @param {boolean} fetchMetaData - Default is false, set if metadata is needed + * @param {number} top - Number of attachments reference to return + * @param {String} continuationToken - Header to pass the continuationToken */ - deleteTemplate(teamContext, templateId) { + getTestRunLogs(customHeaders, project, runId, type, directoryPath, fileNamePrefix, fetchMetaData, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (type == null) { + throw new TypeError('type can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - templateId: templateId + runId: runId + }; + let queryValues = { + type: type, + directoryPath: directoryPath, + fileNamePrefix: fileNamePrefix, + fetchMetaData: fetchMetaData, + top: top, }; + customHeaders = customHeaders || {}; + customHeaders["x-ms-continuationtoken"] = "continuationToken"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "fb10264a-8836-48a0-8033-1b0ccd2748d5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "5b47b946-e875-4c9a-acdc-2a20996caebe", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLog, true); resolve(ret); } catch (err) { @@ -34920,32 +36461,40 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets the template with specified id + * Get SAS Uri of a build attachment * - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} templateId - Template Id + * @param {string} project - Project ID or project name + * @param {number} build - Id of the build to get + * @param {Contracts.TestLogType} type - type of the file + * @param {string} filePath - filePath for which sas uri is needed */ - getTemplate(teamContext, templateId) { + getTestLogStoreEndpointDetailsForBuildLog(project, build, type, filePath) { return __awaiter(this, void 0, void 0, function* () { + if (build == null) { + throw new TypeError('build can not be null or undefined'); + } + if (type == null) { + throw new TypeError('type can not be null or undefined'); + } + if (filePath == null) { + throw new TypeError('filePath can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - templateId: templateId + project: project + }; + let queryValues = { + build: build, + type: type, + filePath: filePath, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "fb10264a-8836-48a0-8033-1b0ccd2748d5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "39b09be7-f0c9-4a83-a513-9ae31b45c56f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false); resolve(ret); } catch (err) { @@ -34955,33 +36504,35 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Replace template contents + * Create and Get sas uri of the build container * - * @param {WorkItemTrackingInterfaces.WorkItemTemplate} templateContent - Template contents to replace with - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {string} templateId - Template id + * @param {string} project - Project ID or project name + * @param {number} buildId - Id of the build to get + * @param {Contracts.TestLogStoreOperationType} testLogStoreOperationType - Type of operation to perform using sas uri */ - replaceTemplate(templateContent, teamContext, templateId) { + testLogStoreEndpointDetailsForBuild(project, buildId, testLogStoreOperationType) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } + if (testLogStoreOperationType == null) { + throw new TypeError('testLogStoreOperationType can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { - project: project, - team: team, - templateId: templateId + project: project + }; + let queryValues = { + buildId: buildId, + testLogStoreOperationType: testLogStoreOperationType, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "fb10264a-8836-48a0-8033-1b0ccd2748d5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "39b09be7-f0c9-4a83-a513-9ae31b45c56f", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, templateContent, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false); resolve(ret); } catch (err) { @@ -34991,27 +36542,39 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns a single update for a work item + * Get SAS Uri of a test results attachment * - * @param {number} id - * @param {number} updateNumber * @param {string} project - Project ID or project name + * @param {number} runId - Id of the test run that contains result + * @param {number} resultId - Id of the test result whose files need to be downloaded + * @param {Contracts.TestLogType} type - type of the file + * @param {string} filePath - filePath for which sas uri is needed */ - getUpdate(id, updateNumber, project) { + getTestLogStoreEndpointDetailsForResultLog(project, runId, resultId, type, filePath) { return __awaiter(this, void 0, void 0, function* () { + if (type == null) { + throw new TypeError('type can not be null or undefined'); + } + if (filePath == null) { + throw new TypeError('filePath can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id, - updateNumber: updateNumber + runId: runId, + resultId: resultId + }; + let queryValues = { + type: type, + filePath: filePath, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "6570bf97-d02c-4a91-8d93-3abe9895b1a9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "da630b37-1236-45b5-945e-1d7bdb673850", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemUpdate, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false); resolve(ret); } catch (err) { @@ -35021,31 +36584,44 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns a the deltas between work item revisions + * Get SAS Uri of a test subresults attachment * - * @param {number} id - * @param {number} top - * @param {number} skip * @param {string} project - Project ID or project name + * @param {number} runId - Id of the test run that contains result + * @param {number} resultId - Id of the test result that contains subresult + * @param {number} subResultId - Id of the test subresult whose file sas uri is needed + * @param {Contracts.TestLogType} type - type of the file + * @param {string} filePath - filePath for which sas uri is needed */ - getUpdates(id, top, skip, project) { + getTestLogStoreEndpointDetailsForSubResultLog(project, runId, resultId, subResultId, type, filePath) { return __awaiter(this, void 0, void 0, function* () { + if (subResultId == null) { + throw new TypeError('subResultId can not be null or undefined'); + } + if (type == null) { + throw new TypeError('type can not be null or undefined'); + } + if (filePath == null) { + throw new TypeError('filePath can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id + runId: runId, + resultId: resultId }; let queryValues = { - '$top': top, - '$skip': skip, + subResultId: subResultId, + type: type, + filePath: filePath, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "6570bf97-d02c-4a91-8d93-3abe9895b1a9", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "da630b37-1236-45b5-945e-1d7bdb673850", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemUpdate, true); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false); resolve(ret); } catch (err) { @@ -35055,37 +36631,44 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets the results of the query given its WIQL. + * Create empty file for a result and Get Sas uri for the file * - * @param {WorkItemTrackingInterfaces.Wiql} wiql - The query containing the WIQL. - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {boolean} timePrecision - Whether or not to use time precision. - * @param {number} top - The max number of results to return. + * @param {string} project - Project ID or project name + * @param {number} runId - Id of the test run that contains the result + * @param {number} resultId - Id of the test results that contains sub result + * @param {number} subResultId - Id of the test sub result whose file sas uri is needed + * @param {string} filePath - file path inside the sub result for which sas uri is needed + * @param {Contracts.TestLogType} type - Type of the file for download */ - queryByWiql(wiql, teamContext, timePrecision, top) { + testLogStoreEndpointDetailsForResult(project, runId, resultId, subResultId, filePath, type) { return __awaiter(this, void 0, void 0, function* () { + if (subResultId == null) { + throw new TypeError('subResultId can not be null or undefined'); + } + if (filePath == null) { + throw new TypeError('filePath can not be null or undefined'); + } + if (type == null) { + throw new TypeError('type can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team + runId: runId, + resultId: resultId }; let queryValues = { - timePrecision: timePrecision, - '$top': top, + subResultId: subResultId, + filePath: filePath, + type: type, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "1a9c53f7-f243-4447-b110-35ef023636e4", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "da630b37-1236-45b5-945e-1d7bdb673850", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, wiql, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemQueryResult, false); + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false); resolve(ret); } catch (err) { @@ -35095,38 +36678,37 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets the results of the query given the query ID. + * Get SAS Uri of a test run attachment * - * @param {string} id - The query ID. - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {boolean} timePrecision - Whether or not to use time precision. - * @param {number} top - The max number of results to return. + * @param {string} project - Project ID or project name + * @param {number} runId - Id of the test run whose file has to be downloaded + * @param {Contracts.TestLogType} type - type of the file + * @param {string} filePath - filePath for which sas uri is needed */ - queryById(id, teamContext, timePrecision, top) { + getTestLogStoreEndpointDetailsForRunLog(project, runId, type, filePath) { return __awaiter(this, void 0, void 0, function* () { + if (type == null) { + throw new TypeError('type can not be null or undefined'); + } + if (filePath == null) { + throw new TypeError('filePath can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let project = null; - let team = null; - if (teamContext) { - project = teamContext.projectId || teamContext.project; - team = teamContext.teamId || teamContext.team; - } let routeValues = { project: project, - team: team, - id: id + runId: runId }; let queryValues = { - timePrecision: timePrecision, - '$top': top, + type: type, + filePath: filePath, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "a02355f5-5f8a-4671-8e32-369d23aac83d", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "67eb3f92-6c97-4fd9-8b63-6cbdc7e526ea", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemQueryResult, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false); resolve(ret); } catch (err) { @@ -35136,29 +36718,36 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get a work item icon given the friendly name and icon color. + * Create empty file for a run and Get Sas uri for the file * - * @param {string} icon - The name of the icon - * @param {string} color - The 6-digit hex color for the icon - * @param {number} v - The version of the icon (used only for cache invalidation) + * @param {string} project - Project ID or project name + * @param {number} runId - Id of the run to get endpoint details + * @param {Contracts.TestLogStoreOperationType} testLogStoreOperationType - Type of operation to perform using sas uri + * @param {string} filePath - file path to create an empty file + * @param {Contracts.TestLogType} type - Default is GeneralAttachment, type of empty file to be created */ - getWorkItemIconJson(icon, color, v) { + testLogStoreEndpointDetailsForRun(project, runId, testLogStoreOperationType, filePath, type) { return __awaiter(this, void 0, void 0, function* () { + if (testLogStoreOperationType == null) { + throw new TypeError('testLogStoreOperationType can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - icon: icon + project: project, + runId: runId }; let queryValues = { - color: color, - v: v, + testLogStoreOperationType: testLogStoreOperationType, + filePath: filePath, + type: type, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "67eb3f92-6c97-4fd9-8b63-6cbdc7e526ea", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestLogStoreEndpointDetails, false); resolve(ret); } catch (err) { @@ -35168,20 +36757,24 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get a list of all work item icons. + * Creates TestResultsSession object in TCM data store * + * @param {Contracts.TestResultsSession} session - Received session object. + * @param {string} project - Project ID or project name */ - getWorkItemIcons() { + createTestSession(session, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "531e61ce-580d-4962-8591-0b2942b6bf78", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, session, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -35191,58 +36784,31 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get a work item icon given the friendly name and icon color. - * - * @param {string} icon - The name of the icon - * @param {string} color - The 6-digit hex color for the icon - * @param {number} v - The version of the icon (used only for cache invalidation) - */ - getWorkItemIconSvg(icon, color, v) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - icon: icon - }; - let queryValues = { - color: color, - v: v, - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues, queryValues); - let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("image/svg+xml", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); - } - catch (err) { - reject(err); - } - })); - }); - } - /** - * Get a work item icon given the friendly name and icon color. + * Retrieves TestResultsSession metadata object in TCM data store * - * @param {string} icon - The name of the icon - * @param {string} color - The 6-digit hex color for the icon - * @param {number} v - The version of the icon (used only for cache invalidation) + * @param {string} project - Project ID or project name + * @param {number} buildId */ - getWorkItemIconXaml(icon, color, v) { + getTestSession(project, buildId) { return __awaiter(this, void 0, void 0, function* () { + if (buildId == null) { + throw new TypeError('buildId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - icon: icon + project: project }; let queryValues = { - color: color, - v: v, + buildId: buildId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "531e61ce-580d-4962-8591-0b2942b6bf78", routeValues, queryValues); let url = verData.requestUrl; - let apiVersion = verData.apiVersion; - let accept = this.createAcceptHeader("image/xaml+xml", apiVersion); - resolve((yield this.http.get(url, { "Accept": accept })).message); + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestResultsSession, true); + resolve(ret); } catch (err) { reject(err); @@ -35251,33 +36817,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get a batch of work item links + * Retrieves TestResultsSession Layout object in TCM data store * * @param {string} project - Project ID or project name - * @param {string[]} linkTypes - A list of types to filter the results to specific link types. Omit this parameter to get work item links of all link types. - * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types. - * @param {string} continuationToken - Specifies the continuationToken to start the batch from. Omit this parameter to get the first batch of links. - * @param {Date} startDateTime - Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter. + * @param {string} sessionId */ - getReportingLinksByLinkType(project, linkTypes, types, continuationToken, startDateTime) { + getTestSessionLayout(project, sessionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - linkTypes: linkTypes && linkTypes.join(","), - types: types && types.join(","), - continuationToken: continuationToken, - startDateTime: startDateTime, + project: project, + sessionId: sessionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "b5b5b6d0-0308-40a1-b3f4-b9bb3c66878f", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "531e61ce-580d-4962-8591-0b2942b6bf78", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -35287,22 +36845,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets the work item relation type definition. + * Updates Test session object associated to a sessionId * - * @param {string} relation - The relation name + * @param {Contracts.TestResultsSession} session - Update Session object + * @param {string} project - Project ID or project name + * @param {number} sessionId - Id of TestResults session to update Test session object for. */ - getRelationType(relation) { + updateTestSession(session, project, sessionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - relation: relation + project: project, + sessionId: sessionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "531e61ce-580d-4962-8591-0b2942b6bf78", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.update(url, session, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -35313,19 +36874,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets the work item relation types. + * Creates Session Analysis object in TCM data store for a given session * + * @param {Contracts.TestSessionAnalysis[]} analysis - Session Analysis details + * @param {string} project - Project ID or project name + * @param {number} sessionId - ID of Session to add Notification */ - getRelationTypes() { + createAnalysis(analysis, project, sessionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project, + sessionId: sessionId + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "c83eaf52-edf3-4034-ae11-17d38f25404c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.create(url, analysis, options); let ret = this.formatResponse(res.result, null, true); resolve(ret); } @@ -35336,46 +36903,23 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get a batch of work item revisions with the option of including deleted items + * Creates Environment object in TCM data store * + * @param {Contracts.TestSessionEnvironment[]} environments - Received Environment object. * @param {string} project - Project ID or project name - * @param {string[]} fields - A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. - * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. - * @param {string} continuationToken - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. - * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. - * @param {boolean} includeIdentityRef - Return an identity reference instead of a string value for identity fields. - * @param {boolean} includeDeleted - Specify if the deleted item should be returned. - * @param {boolean} includeTagRef - Specify if the tag objects should be returned for System.Tags field. - * @param {boolean} includeLatestOnly - Return only the latest revisions of work items, skipping all historical revisions - * @param {WorkItemTrackingInterfaces.ReportingRevisionsExpand} expand - Return all the fields in work item revisions, including long text fields which are not returned by default - * @param {boolean} includeDiscussionChangesOnly - Return only the those revisions of work items, where only history field was changed - * @param {number} maxPageSize - The maximum number of results to return in this batch */ - readReportingRevisionsGet(project, fields, types, continuationToken, startDateTime, includeIdentityRef, includeDeleted, includeTagRef, includeLatestOnly, expand, includeDiscussionChangesOnly, maxPageSize) { + createEnvironment(environments, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; - let queryValues = { - fields: fields && fields.join(","), - types: types && types.join(","), - continuationToken: continuationToken, - startDateTime: startDateTime, - includeIdentityRef: includeIdentityRef, - includeDeleted: includeDeleted, - includeTagRef: includeTagRef, - includeLatestOnly: includeLatestOnly, - '$expand': expand, - includeDiscussionChangesOnly: includeDiscussionChangesOnly, - '$maxPageSize': maxPageSize, - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "f828fe59-dd87-495d-a17c-7a8d6211ca6c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "f9c2e9e4-9c9a-4c1d-9a7d-2b4c8a6f0d5f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.create(url, environments, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -35386,31 +36930,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get a batch of work item revisions. This request may be used if your list of fields is large enough that it may run the URL over the length limit. + * For the provided sessionId, creates environment, configuration, and machine objects in TCM data store * - * @param {WorkItemTrackingInterfaces.ReportingWorkItemRevisionsFilter} filter - An object that contains request settings: field filter, type filter, identity format + * @param {Contracts.SessionEnvironmentAndMachine} sessionEnvironmentAndMachine * @param {string} project - Project ID or project name - * @param {string} continuationToken - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. - * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. - * @param {WorkItemTrackingInterfaces.ReportingRevisionsExpand} expand + * @param {number} sessionId */ - readReportingRevisionsPost(filter, project, continuationToken, startDateTime, expand) { + createEnvironmentAndMachine(sessionEnvironmentAndMachine, project, sessionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - continuationToken: continuationToken, - startDateTime: startDateTime, - '$expand': expand, + project: project, + sessionId: sessionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "f828fe59-dd87-495d-a17c-7a8d6211ca6c", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "502ab173-18a6-427a-bee1-4068126b3e9b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, filter, options); + res = yield this.rest.create(url, sessionEnvironmentAndMachine, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -35421,27 +36959,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** + * Retrieves TestResultsSession Layout object in TCM data store + * * @param {string} project - Project ID or project name - * @param {string} continuationToken - * @param {number} maxPageSize + * @param {number} sessionId - Retrieve session object. */ - readReportingDiscussions(project, continuationToken, maxPageSize) { + getTestSessionLayoutBySessionId(project, sessionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - continuationToken: continuationToken, - '$maxPageSize': maxPageSize, + project: project, + sessionId: sessionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "4a644469-90c5-4fcc-9a9f-be0827d369ec", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "815d3979-81bd-4018-94fd-62000fc43163", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -35451,39 +36987,26 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Creates a single work item. + * Creates Notification object in TCM data store for a given session * - * @param {VSSInterfaces.JsonPatchDocument} document - The JSON Patch document representing the work item + * @param {Contracts.TestSessionNotification[]} notifications - Notification(s) to add for the specified sessionId * @param {string} project - Project ID or project name - * @param {string} type - The work item type of the work item to create - * @param {boolean} validateOnly - Indicate if you only want to validate the changes without saving the work item - * @param {boolean} bypassRules - Do not enforce the work item type rules on this update - * @param {boolean} suppressNotifications - Do not fire any notifications for this change - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. + * @param {number} sessionId - ID of Session to add Notification */ - createWorkItem(customHeaders, document, project, type, validateOnly, bypassRules, suppressNotifications, expand) { + createNotification(notifications, project, sessionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - type: type - }; - let queryValues = { - validateOnly: validateOnly, - bypassRules: bypassRules, - suppressNotifications: suppressNotifications, - '$expand': expand, + sessionId: sessionId }; - customHeaders = customHeaders || {}; - customHeaders["Content-Type"] = "application/json-patch+json"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "62d3d110-0047-428c-ad3c-4fe872c91c74", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "ebff1c56-2188-4082-9d0e-1838a396f0c8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); - options.additionalHeaders = customHeaders; let res; - res = yield this.rest.create(url, document, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, notifications, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -35493,33 +37016,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns a single work item from a template. + * Retrieves TestResultsSession Notification objects in TCM data store * * @param {string} project - Project ID or project name - * @param {string} type - The work item type name - * @param {string} fields - Comma-separated list of requested fields - * @param {Date} asOf - AsOf UTC date time string - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. + * @param {number} sessionId - Id of TestResults session to obtain Notifications for. */ - getWorkItemTemplate(project, type, fields, asOf, expand) { + getSessionNotifications(project, sessionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - type: type - }; - let queryValues = { - fields: fields, - asOf: asOf, - '$expand': expand, + sessionId: sessionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "62d3d110-0047-428c-ad3c-4fe872c91c74", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "ebff1c56-2188-4082-9d0e-1838a396f0c8", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -35529,29 +37044,26 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. + * Add Test Results to test run session * - * @param {number} id - ID of the work item to be deleted + * @param {Contracts.TestCaseResult[]} results * @param {string} project - Project ID or project name - * @param {boolean} destroy - Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. + * @param {number} runId - RunId of test run */ - deleteWorkItem(id, project, destroy) { + addTestResultsToTestRunSession(results, project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id - }; - let queryValues = { - destroy: destroy, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "ee6d95bf-7506-4c47-8100-9fed82cdc2f7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, results, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -35561,33 +37073,35 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns a single work item. - * - * @param {number} id - The work item id - * @param {string[]} fields - Comma-separated list of requested fields - * @param {Date} asOf - AsOf UTC date time string - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. * @param {string} project - Project ID or project name + * @param {number} runId + * @param {Contracts.ResultDetails} detailsToInclude + * @param {number} skip + * @param {number} top + * @param {Contracts.TestOutcome[]} outcomes + * @param {boolean} newTestsOnly */ - getWorkItem(id, fields, asOf, expand, project) { + getTestSessionResults(project, runId, detailsToInclude, skip, top, outcomes, newTestsOnly) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id + runId: runId }; let queryValues = { - fields: fields && fields.join(","), - asOf: asOf, - '$expand': expand, + detailsToInclude: detailsToInclude, + '$skip': skip, + '$top': top, + outcomes: outcomes && outcomes.join(","), + '$newTestsOnly': newTestsOnly, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "ee6d95bf-7506-4c47-8100-9fed82cdc2f7", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -35597,37 +37111,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns a list of work items (Maximum 200) + * Creates TestResultsMRX objects in TCM data store for existing test results * - * @param {number[]} ids - The comma-separated list of requested work item ids. (Maximum 200 ids allowed). - * @param {string[]} fields - Comma-separated list of requested fields - * @param {Date} asOf - AsOf UTC date time string - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. - * @param {WorkItemTrackingInterfaces.WorkItemErrorPolicy} errorPolicy - The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}. + * @param {Contracts.TestCaseResult[]} results - Results object with only test results MRX properties and existing testResultId * @param {string} project - Project ID or project name + * @param {number} runId - RunId of test run */ - getWorkItems(ids, fields, asOf, expand, errorPolicy, project) { + updateTestResultsToTestRunSession(results, project, runId) { return __awaiter(this, void 0, void 0, function* () { - if (ids == null) { - throw new TypeError('ids can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project - }; - let queryValues = { - ids: ids && ids.join(","), - fields: fields && fields.join(","), - asOf: asOf, - '$expand': expand, - errorPolicy: errorPolicy, + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "ee6d95bf-7506-4c47-8100-9fed82cdc2f7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.update(url, results, options); let ret = this.formatResponse(res.result, null, true); resolve(ret); } @@ -35638,38 +37140,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Updates a single work item. + * Creates test result machines for the provided TestRunId * - * @param {VSSInterfaces.JsonPatchDocument} document - The JSON Patch document representing the update - * @param {number} id - The id of the work item to update + * @param {Contracts.TestResultMachine[]} testResultMachines - List of machines for test results in the run * @param {string} project - Project ID or project name - * @param {boolean} validateOnly - Indicate if you only want to validate the changes without saving the work item - * @param {boolean} bypassRules - Do not enforce the work item type rules on this update - * @param {boolean} suppressNotifications - Do not fire any notifications for this change - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. + * @param {number} runId - ID of the TestRun to add machines for */ - updateWorkItem(customHeaders, document, id, project, validateOnly, bypassRules, suppressNotifications, expand) { + createTestResultMachines(testResultMachines, project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - id: id - }; - let queryValues = { - validateOnly: validateOnly, - bypassRules: bypassRules, - suppressNotifications: suppressNotifications, - '$expand': expand, + runId: runId }; - customHeaders = customHeaders || {}; - customHeaders["Content-Type"] = "application/json-patch+json"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "6485f27f-50a7-401e-828f-a8ee90978817", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); - options.additionalHeaders = customHeaders; let res; - res = yield this.rest.update(url, document, options); + res = yield this.rest.create(url, testResultMachines, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -35680,23 +37169,24 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Gets work items for a list of work item ids (Maximum 200) + * Gets test result machines for the provided TestRunId * - * @param {WorkItemTrackingInterfaces.WorkItemBatchGetRequest} workItemGetRequest * @param {string} project - Project ID or project name + * @param {number} runId - ID of the TestRun to add machines for */ - getWorkItemsBatch(workItemGetRequest, project) { + getTestResultMachines(project, runId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + runId: runId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "908509b6-4248-4475-a1cd-829139ba419f", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "6485f27f-50a7-401e-828f-a8ee90978817", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, workItemGetRequest, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, true); resolve(ret); } @@ -35707,21 +37197,46 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * INTERNAL ONLY: It will be used for My account work experience. Get the work item type state color for multiple projects + * Gets full TestCaseResult objects with 1MRX details for the provided pipelineId * - * @param {string[]} projectNames + * @param {string} project - Project ID or project name + * @param {number} pipelineId - Pipeline Id. This is same as build Id. + * @param {string} stageName - Name of the stage. Maximum supported length for name is 256 character. + * @param {string} phaseName - Name of the phase. Maximum supported length for name is 256 character. + * @param {string} jobName - Matrixing in YAML generates copies of a job with different inputs in matrix. JobName is the name of those input. Maximum supported length for name is 256 character. + * @param {Contracts.TestOutcome[]} outcomes - List of outcome of results + * @param {boolean} includeAllBuildRuns - Whether to include Test Runs from from all the build runs or not. Defaults to false. + * @param {number} top - Maximum number of results to return. Defaults to 10000. + * @param {String} continuationToken - Header to pass the continuationToken */ - getWorkItemStateColors(projectNames) { + getTestResultsByPipelineMRX(customHeaders, project, pipelineId, stageName, phaseName, jobName, outcomes, includeAllBuildRuns, top, continuationToken) { return __awaiter(this, void 0, void 0, function* () { + if (pipelineId == null) { + throw new TypeError('pipelineId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project + }; + let queryValues = { + pipelineId: pipelineId, + stageName: stageName, + phaseName: phaseName, + jobName: jobName, + outcomes: outcomes && outcomes.join(","), + includeAllBuildRuns: includeAllBuildRuns, + '$top': top, + }; + customHeaders = customHeaders || {}; + customHeaders["x-ms-continuationtoken"] = "continuationToken"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "0b83df8a-3496-4ddb-ba44-63634f4cda61", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "607f51d4-91a2-4ea4-a496-b3d58a7baea1", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.create(url, projectNames, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestCaseResult, true); resolve(ret); } catch (err) { @@ -35731,24 +37246,20 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns the next state on the given work item IDs. + * Retrieves Test runs associated to a session * - * @param {number[]} ids - list of work item ids - * @param {string} action - possible actions. Currently only supports checkin + * @param {string} project - Project ID or project name + * @param {number} sessionId - Id of TestResults session to obtain Test Runs for. */ - getWorkItemNextStatesOnCheckinAction(ids, action) { + getTestRunsBySessionId(project, sessionId) { return __awaiter(this, void 0, void 0, function* () { - if (ids == null) { - throw new TypeError('ids can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - ids: ids && ids.join(","), - action: action, + let routeValues = { + project: project, + sessionId: sessionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "afae844b-e2f6-44c2-8053-17b3bb936a40", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "6efc2c12-d4bf-4e86-ae37-b502e57a84c7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -35763,22 +37274,25 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get all work item type categories. + * Updates Test runs associated to a session * + * @param {Contracts.TestSessionTestRun} testRunIds * @param {string} project - Project ID or project name + * @param {number} sessionId - Id of TestResults session to update Test Runs for. */ - getWorkItemTypeCategories(project) { + updateTestRunsBySessionId(testRunIds, project, sessionId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project + project: project, + sessionId: sessionId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "9b9f5734-36c8-415e-ba67-f83b45c31408", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "6efc2c12-d4bf-4e86-ae37-b502e57a84c7", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.update(url, testRunIds, options); let ret = this.formatResponse(res.result, null, true); resolve(ret); } @@ -35789,24 +37303,21 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get specific work item type category by name. - * + * @param {Contracts.TestSettings} testSettings * @param {string} project - Project ID or project name - * @param {string} category - The category name */ - getWorkItemTypeCategory(project, category) { + createTestSettings(testSettings, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - category: category + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "9b9f5734-36c8-415e-ba67-f83b45c31408", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "930bad47-f826-4099-9597-f44d0a9c735c", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.create(url, testSettings, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -35817,21 +37328,28 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * INTERNAL ONLY: It will be used for My account work experience. Get the wit type color for multiple projects - * - * @param {string[]} projectNames + * @param {string} project - Project ID or project name + * @param {number} testSettingsId */ - getWorkItemTypeColors(projectNames) { + deleteTestSettings(project, testSettingsId) { return __awaiter(this, void 0, void 0, function* () { + if (testSettingsId == null) { + throw new TypeError('testSettingsId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project + }; + let queryValues = { + testSettingsId: testSettingsId, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "958fde80-115e-43fb-bd65-749c48057faf", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "930bad47-f826-4099-9597-f44d0a9c735c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, projectNames, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -35841,21 +37359,28 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * INTERNAL ONLY: It is used for color and icon providers. Get the wit type color for multiple projects - * - * @param {string[]} projectNames + * @param {string} project - Project ID or project name + * @param {number} testSettingsId */ - getWorkItemTypeColorAndIcons(projectNames) { + getTestSettingsById(project, testSettingsId) { return __awaiter(this, void 0, void 0, function* () { + if (testSettingsId == null) { + throw new TypeError('testSettingsId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let routeValues = { + project: project + }; + let queryValues = { + testSettingsId: testSettingsId, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "f0f8dc62-3975-48ce-8051-f636b68b52e3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "testresults", "930bad47-f826-4099-9597-f44d0a9c735c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, projectNames, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -35865,25 +37390,22 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns a work item type definition. - * + * @param {Contracts.WorkItemToTestLinks} workItemToTestLinks * @param {string} project - Project ID or project name - * @param {string} type - Work item type name */ - getWorkItemType(project, type) { + addWorkItemToTestLinks(workItemToTestLinks, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - type: type + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "4e3abe63-ca46-4fe0-98b2-363f7ec7aa5f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, workItemToTestLinks, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.WorkItemToTestLinks, false); resolve(ret); } catch (err) { @@ -35893,23 +37415,33 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Returns the list of work item types - * * @param {string} project - Project ID or project name + * @param {string} testName + * @param {number} workItemId */ - getWorkItemTypes(project) { + deleteTestMethodToWorkItemLink(project, testName, workItemId) { return __awaiter(this, void 0, void 0, function* () { + if (testName == null) { + throw new TypeError('testName can not be null or undefined'); + } + if (workItemId == null) { + throw new TypeError('workItemId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project }; + let queryValues = { + testName: testName, + workItemId: workItemId, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "wit", "7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "cbd50bd7-f7ed-4e35-b127-4408ae6bfa2c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -35919,29 +37451,28 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get a list of fields for a work item type with detailed references. - * * @param {string} project - Project ID or project name - * @param {string} type - Work item type. - * @param {WorkItemTrackingInterfaces.WorkItemTypeFieldsExpandLevel} expand - Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties. + * @param {string} testName */ - getWorkItemTypeFieldsWithReferences(project, type, expand) { + queryTestMethodLinkedWorkItems(project, testName) { return __awaiter(this, void 0, void 0, function* () { + if (testName == null) { + throw new TypeError('testName can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - type: type + project: project }; let queryValues = { - '$expand': expand, + testName: testName, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "bd293ce5-3d25-4192-8e67-e8092e879efb", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "cbd50bd7-f7ed-4e35-b127-4408ae6bfa2c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, Contracts.TypeInfo.TestToWorkItemLinks, false); resolve(ret); } catch (err) { @@ -35951,54 +37482,20 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Get a field for a work item type with detailed references. - * * @param {string} project - Project ID or project name - * @param {string} type - Work item type. - * @param {string} field - * @param {WorkItemTrackingInterfaces.WorkItemTypeFieldsExpandLevel} expand - Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties. + * @param {number} runId + * @param {number} testCaseResultId */ - getWorkItemTypeFieldWithReferences(project, type, field, expand) { + getTestResultWorkItemsById(project, runId, testCaseResultId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { project: project, - type: type, - field: field - }; - let queryValues = { - '$expand': expand, + runId: runId, + testCaseResultId: testCaseResultId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.3", "wit", "bd293ce5-3d25-4192-8e67-e8092e879efb", routeValues, queryValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); - }); - } - /** - * Returns the state names and colors for a work item type. - * - * @param {string} project - Project ID or project name - * @param {string} type - The state name - */ - getWorkItemTypeStates(project, type) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project, - type: type - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "7c9d7a76-4a09-43e8-b5df-bd792f4ac6aa", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "3d032fd6-e7a0-468b-b105-75d206f99aad", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -36013,56 +37510,40 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } /** - * Export work item type + * Query Test Result WorkItems based on filter * * @param {string} project - Project ID or project name - * @param {string} type - * @param {boolean} exportGlobalLists + * @param {string} workItemCategory - can take values Microsoft.BugCategory or all(for getting all workitems) + * @param {string} automatedTestName + * @param {number} testCaseId + * @param {Date} maxCompleteDate + * @param {number} days + * @param {number} workItemCount */ - exportWorkItemTypeDefinition(project, type, exportGlobalLists) { + queryTestResultWorkItems(project, workItemCategory, automatedTestName, testCaseId, maxCompleteDate, days, workItemCount) { return __awaiter(this, void 0, void 0, function* () { + if (workItemCategory == null) { + throw new TypeError('workItemCategory can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - project: project, - type: type + project: project }; let queryValues = { - exportGlobalLists: exportGlobalLists, + workItemCategory: workItemCategory, + automatedTestName: automatedTestName, + testCaseId: testCaseId, + maxCompleteDate: maxCompleteDate, + days: days, + '$workItemCount': workItemCount, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "8637ac8b-5eb6-4f90-b3f7-4f2ff576a459", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "testresults", "f7401a26-331b-44fe-a470-f7ed35138e4a", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); - }); - } - /** - * Add/updates a work item type - * - * @param {WorkItemTrackingInterfaces.WorkItemTypeTemplateUpdateModel} updateModel - * @param {string} project - Project ID or project name - */ - updateWorkItemTypeDefinition(updateModel, project) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - project: project - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "wit", "8637ac8b-5eb6-4f90-b3f7-4f2ff576a459", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, updateModel, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -36072,13 +37553,13 @@ class WorkItemTrackingApi extends basem.ClientApiBase { }); } } -WorkItemTrackingApi.RESOURCE_AREA_ID = "5264459e-e5e0-4bd8-b118-0985e68a4ec5"; -exports.WorkItemTrackingApi = WorkItemTrackingApi; +exports.TestResultsApi = TestResultsApi; +TestResultsApi.RESOURCE_AREA_ID = "c83eaf52-edf3-4034-ae11-17d38f25404c"; /***/ }), -/***/ 1178: +/***/ 5417: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -36093,39 +37574,51 @@ exports.WorkItemTrackingApi = WorkItemTrackingApi; * --------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TfvcApi = void 0; const basem = __nccwpck_require__(273); -const WorkItemTrackingProcessInterfaces = __nccwpck_require__(4524); -class WorkItemTrackingProcessApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-WorkItemTracking-api', options); +const TfvcInterfaces = __nccwpck_require__(9003); +class TfvcApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Tfvc-api', options); } /** - * Creates a single behavior in the given process. + * Get a single branch hierarchy at the given path with parents or children as specified. * - * @param {WorkItemTrackingProcessInterfaces.ProcessBehaviorCreateRequest} behavior - * @param {string} processId - The ID of the process + * @param {string} path - Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder. + * @param {string} project - Project ID or project name + * @param {boolean} includeParent - Return the parent branch, if there is one. Default: False + * @param {boolean} includeChildren - Return child branches, if there are any. Default: False */ - createProcessBehavior(behavior, processId) { + getBranch(path, project, includeParent, includeChildren) { return __awaiter(this, void 0, void 0, function* () { + if (path == null) { + throw new TypeError('path can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId + project: project + }; + let queryValues = { + path: path, + includeParent: includeParent, + includeChildren: includeChildren, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "bc1f417e-239d-42e7-85e1-76e80cb2d6eb", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, behavior, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcBranch, false); resolve(ret); } catch (err) { @@ -36135,25 +37628,33 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Removes a behavior in the process. + * Get a collection of branch roots -- first-level children, branches with no parents. * - * @param {string} processId - The ID of the process - * @param {string} behaviorRefName - The reference name of the behavior + * @param {string} project - Project ID or project name + * @param {boolean} includeParent - Return the parent branch, if there is one. Default: False + * @param {boolean} includeChildren - Return the child branches for each root branch. Default: False + * @param {boolean} includeDeleted - Return deleted branches. Default: False + * @param {boolean} includeLinks - Return links. Default: False */ - deleteProcessBehavior(processId, behaviorRefName) { + getBranches(project, includeParent, includeChildren, includeDeleted, includeLinks) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - behaviorRefName: behaviorRefName + project: project + }; + let queryValues = { + includeParent: includeParent, + includeChildren: includeChildren, + includeDeleted: includeDeleted, + includeLinks: includeLinks, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "bc1f417e-239d-42e7-85e1-76e80cb2d6eb", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcBranch, true); resolve(ret); } catch (err) { @@ -36163,29 +37664,34 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns a behavior of the process. + * Get branch hierarchies below the specified scopePath * - * @param {string} processId - The ID of the process - * @param {string} behaviorRefName - The reference name of the behavior - * @param {WorkItemTrackingProcessInterfaces.GetBehaviorsExpand} expand + * @param {string} scopePath - Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder. + * @param {string} project - Project ID or project name + * @param {boolean} includeDeleted - Return deleted branches. Default: False + * @param {boolean} includeLinks - Return links. Default: False */ - getProcessBehavior(processId, behaviorRefName, expand) { + getBranchRefs(scopePath, project, includeDeleted, includeLinks) { return __awaiter(this, void 0, void 0, function* () { + if (scopePath == null) { + throw new TypeError('scopePath can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - behaviorRefName: behaviorRefName + project: project }; let queryValues = { - '$expand': expand, + scopePath: scopePath, + includeDeleted: includeDeleted, + includeLinks: includeLinks, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "bc1f417e-239d-42e7-85e1-76e80cb2d6eb", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, false); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcBranchRef, true); resolve(ret); } catch (err) { @@ -36195,27 +37701,29 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns a list of all behaviors in the process. + * Retrieve Tfvc changes for a given changeset. * - * @param {string} processId - The ID of the process - * @param {WorkItemTrackingProcessInterfaces.GetBehaviorsExpand} expand + * @param {number} id - ID of the changeset. Default: null + * @param {number} skip - Number of results to skip. Default: null + * @param {number} top - The maximum number of results to return. Default: null */ - getProcessBehaviors(processId, expand) { + getChangesetChanges(id, skip, top) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId + id: id }; let queryValues = { - '$expand': expand, + '$skip': skip, + '$top': top, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "f32b86f2-15b9-4fe6-81b1-6f8938617ee5", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, true); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChange, true); resolve(ret); } catch (err) { @@ -36225,26 +37733,24 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Replaces a behavior in the process. + * Create a new changeset. * - * @param {WorkItemTrackingProcessInterfaces.ProcessBehaviorUpdateRequest} behaviorData - * @param {string} processId - The ID of the process - * @param {string} behaviorRefName - The reference name of the behavior + * @param {TfvcInterfaces.TfvcChangeset} changeset + * @param {string} project - Project ID or project name */ - updateProcessBehavior(behaviorData, processId, behaviorRefName) { + createChangeset(changeset, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - behaviorRefName: behaviorRefName + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "tfvc", "0bc8f0a4-6bfb-42a9-ba84-139da7b99c49", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, behaviorData, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, false); + res = yield this.rest.create(url, changeset, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangesetRef, false); resolve(ret); } catch (err) { @@ -36254,28 +37760,45 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Creates a control in a group. + * Retrieve a Tfvc Changeset * - * @param {WorkItemTrackingProcessInterfaces.Control} control - The control. - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} groupId - The ID of the group to add the control to. + * @param {number} id - Changeset Id to retrieve. + * @param {string} project - Project ID or project name + * @param {number} maxChangeCount - Number of changes to return (maximum 100 changes) Default: 0 + * @param {boolean} includeDetails - Include policy details and check-in notes in the response. Default: false + * @param {boolean} includeWorkItems - Include workitems. Default: false + * @param {number} maxCommentLength - Include details about associated work items in the response. Default: null + * @param {boolean} includeSourceRename - Include renames. Default: false + * @param {number} skip - Number of results to skip. Default: null + * @param {number} top - The maximum number of results to return. Default: null + * @param {string} orderby - Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order. + * @param {TfvcInterfaces.TfvcChangesetSearchCriteria} searchCriteria - Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null */ - createControlInGroup(control, processId, witRefName, groupId) { + getChangeset(id, project, maxChangeCount, includeDetails, includeWorkItems, maxCommentLength, includeSourceRename, skip, top, orderby, searchCriteria) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - groupId: groupId + project: project, + id: id + }; + let queryValues = { + maxChangeCount: maxChangeCount, + includeDetails: includeDetails, + includeWorkItems: includeWorkItems, + maxCommentLength: maxCommentLength, + includeSourceRename: includeSourceRename, + '$skip': skip, + '$top': top, + '$orderby': orderby, + searchCriteria: searchCriteria, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "tfvc", "0bc8f0a4-6bfb-42a9-ba84-139da7b99c49", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, control, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangeset, false); resolve(ret); } catch (err) { @@ -36285,34 +37808,35 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Moves a control to a specified group. + * Retrieve Tfvc Changesets * - * @param {WorkItemTrackingProcessInterfaces.Control} control - The control. - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} groupId - The ID of the group to move the control to. - * @param {string} controlId - The ID of the control. - * @param {string} removeFromGroupId - The group ID to remove the control from. + * @param {string} project - Project ID or project name + * @param {number} maxCommentLength - Include details about associated work items in the response. Default: null + * @param {number} skip - Number of results to skip. Default: null + * @param {number} top - The maximum number of results to return. Default: null + * @param {string} orderby - Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order. + * @param {TfvcInterfaces.TfvcChangesetSearchCriteria} searchCriteria - Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null */ - moveControlToGroup(control, processId, witRefName, groupId, controlId, removeFromGroupId) { + getChangesets(project, maxCommentLength, skip, top, orderby, searchCriteria) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - groupId: groupId, - controlId: controlId + project: project }; let queryValues = { - removeFromGroupId: removeFromGroupId, + maxCommentLength: maxCommentLength, + '$skip': skip, + '$top': top, + '$orderby': orderby, + searchCriteria: searchCriteria, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "tfvc", "0bc8f0a4-6bfb-42a9-ba84-139da7b99c49", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, control, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangesetRef, true); resolve(ret); } catch (err) { @@ -36322,29 +37846,21 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Removes a control from the work item form. + * Returns changesets for a given list of changeset Ids. * - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} groupId - The ID of the group. - * @param {string} controlId - The ID of the control to remove. + * @param {TfvcInterfaces.TfvcChangesetsRequestData} changesetsRequestData - List of changeset IDs. */ - removeControlFromGroup(processId, witRefName, groupId, controlId) { + getBatchedChangesets(changesetsRequestData) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName, - groupId: groupId, - controlId: controlId - }; + let routeValues = {}; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "b7e7c173-803c-4fea-9ec8-31ee35c5502a", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, changesetsRequestData, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangesetRef, true); resolve(ret); } catch (err) { @@ -36354,30 +37870,23 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Updates a control on the work item form. + * Retrieves the work items associated with a particular changeset. * - * @param {WorkItemTrackingProcessInterfaces.Control} control - The updated control. - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} groupId - The ID of the group. - * @param {string} controlId - The ID of the control. + * @param {number} id - ID of the changeset. */ - updateControl(control, processId, witRefName, groupId, controlId) { + getChangesetWorkItems(id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - groupId: groupId, - controlId: controlId + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "64ae0bea-1d71-47c9-a9e5-fe73f5ea0ff4", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, control, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -36387,26 +37896,24 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Adds a field to a work item type. + * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. * - * @param {WorkItemTrackingProcessInterfaces.AddProcessWorkItemTypeFieldRequest} field - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. + * @param {TfvcInterfaces.TfvcItemRequestData} itemRequestData + * @param {string} project - Project ID or project name */ - addFieldToWorkItemType(field, processId, witRefName) { + getItemsBatch(itemRequestData, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "fe6f827b-5f64-480f-b8af-1eca3b80e833", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, field, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, false); + res = yield this.rest.create(url, itemRequestData, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, true); resolve(ret); } catch (err) { @@ -36416,26 +37923,23 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns a list of all fields in a work item type. + * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. * - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. + * @param {TfvcInterfaces.TfvcItemRequestData} itemRequestData + * @param {string} project - Project ID or project name */ - getAllWorkItemTypeFields(processId, witRefName) { + getItemsBatchZip(itemRequestData, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "fe6f827b-5f64-480f-b8af-1eca3b80e833", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.post(url, JSON.stringify(itemRequestData), { "Accept": accept, "Content-Type": "application/json" })).message); } catch (err) { reject(err); @@ -36444,31 +37948,42 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns a field in a work item type. + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. * - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} fieldRefName - The reference name of the field. - * @param {WorkItemTrackingProcessInterfaces.ProcessWorkItemTypeFieldsExpandLevel} expand + * @param {string} path - Version control path of an individual item to return. + * @param {string} project - Project ID or project name + * @param {string} fileName - file name of item returned. + * @param {boolean} download - If true, create a downloadable attachment. + * @param {string} scopePath - Version control path of a folder to return multiple items. + * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder). + * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null. + * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. */ - getWorkItemTypeField(processId, witRefName, fieldRefName, expand) { + getItem(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) { return __awaiter(this, void 0, void 0, function* () { + if (path == null) { + throw new TypeError('path can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - fieldRefName: fieldRefName + project: project }; let queryValues = { - '$expand': expand, + path: path, + fileName: fileName, + download: download, + scopePath: scopePath, + recursionLevel: recursionLevel, + versionDescriptor: versionDescriptor, + includeContent: includeContent, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, false); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, false); resolve(ret); } catch (err) { @@ -36478,28 +37993,41 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Removes a field from a work item type. Does not permanently delete the field. + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. * - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} fieldRefName - The reference name of the field. + * @param {string} path - Version control path of an individual item to return. + * @param {string} project - Project ID or project name + * @param {string} fileName - file name of item returned. + * @param {boolean} download - If true, create a downloadable attachment. + * @param {string} scopePath - Version control path of a folder to return multiple items. + * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder). + * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null. + * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. */ - removeWorkItemTypeField(processId, witRefName, fieldRefName) { + getItemContent(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) { return __awaiter(this, void 0, void 0, function* () { + if (path == null) { + throw new TypeError('path can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - fieldRefName: fieldRefName + project: project + }; + let queryValues = { + path: path, + fileName: fileName, + download: download, + scopePath: scopePath, + recursionLevel: recursionLevel, + versionDescriptor: versionDescriptor, + includeContent: includeContent, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -36508,28 +38036,33 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Updates a field in a work item type. + * Get a list of Tfvc items * - * @param {WorkItemTrackingProcessInterfaces.UpdateProcessWorkItemTypeFieldRequest} field - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} fieldRefName - The reference name of the field. + * @param {string} project - Project ID or project name + * @param {string} scopePath - Version control path of a folder to return multiple items. + * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder). + * @param {boolean} includeLinks - True to include links. + * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor */ - updateWorkItemTypeField(field, processId, witRefName, fieldRefName) { + getItems(project, scopePath, recursionLevel, includeLinks, versionDescriptor) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - fieldRefName: fieldRefName + project: project + }; + let queryValues = { + scopePath: scopePath, + recursionLevel: recursionLevel, + includeLinks: includeLinks, + versionDescriptor: versionDescriptor, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, field, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, true); resolve(ret); } catch (err) { @@ -36539,31 +38072,41 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Adds a group to the work item form. + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. * - * @param {WorkItemTrackingProcessInterfaces.Group} group - The group. - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} pageId - The ID of the page to add the group to. - * @param {string} sectionId - The ID of the section to add the group to. + * @param {string} path - Version control path of an individual item to return. + * @param {string} project - Project ID or project name + * @param {string} fileName - file name of item returned. + * @param {boolean} download - If true, create a downloadable attachment. + * @param {string} scopePath - Version control path of a folder to return multiple items. + * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder). + * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null. + * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. */ - addGroup(group, processId, witRefName, pageId, sectionId) { + getItemText(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) { return __awaiter(this, void 0, void 0, function* () { + if (path == null) { + throw new TypeError('path can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId, - sectionId: sectionId + project: project + }; + let queryValues = { + path: path, + fileName: fileName, + download: download, + scopePath: scopePath, + recursionLevel: recursionLevel, + versionDescriptor: versionDescriptor, + includeContent: includeContent, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, group, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -36572,87 +38115,41 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Moves a group to a different page and section. + * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. * - * @param {WorkItemTrackingProcessInterfaces.Group} group - The updated group. - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} pageId - The ID of the page the group is in. - * @param {string} sectionId - The ID of the section the group is i.n - * @param {string} groupId - The ID of the group. - * @param {string} removeFromPageId - ID of the page to remove the group from. - * @param {string} removeFromSectionId - ID of the section to remove the group from. + * @param {string} path - Version control path of an individual item to return. + * @param {string} project - Project ID or project name + * @param {string} fileName - file name of item returned. + * @param {boolean} download - If true, create a downloadable attachment. + * @param {string} scopePath - Version control path of a folder to return multiple items. + * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder). + * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null. + * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false. */ - moveGroupToPage(group, processId, witRefName, pageId, sectionId, groupId, removeFromPageId, removeFromSectionId) { + getItemZip(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) { return __awaiter(this, void 0, void 0, function* () { - if (removeFromPageId == null) { - throw new TypeError('removeFromPageId can not be null or undefined'); - } - if (removeFromSectionId == null) { - throw new TypeError('removeFromSectionId can not be null or undefined'); + if (path == null) { + throw new TypeError('path can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId, - sectionId: sectionId, - groupId: groupId + project: project }; let queryValues = { - removeFromPageId: removeFromPageId, - removeFromSectionId: removeFromSectionId, - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues, queryValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.replace(url, group, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); - }); - } - /** - * Moves a group to a different section. - * - * @param {WorkItemTrackingProcessInterfaces.Group} group - The updated group. - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} pageId - The ID of the page the group is in. - * @param {string} sectionId - The ID of the section the group is in. - * @param {string} groupId - The ID of the group. - * @param {string} removeFromSectionId - ID of the section to remove the group from. - */ - moveGroupToSection(group, processId, witRefName, pageId, sectionId, groupId, removeFromSectionId) { - return __awaiter(this, void 0, void 0, function* () { - if (removeFromSectionId == null) { - throw new TypeError('removeFromSectionId can not be null or undefined'); - } - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId, - sectionId: sectionId, - groupId: groupId - }; - let queryValues = { - removeFromSectionId: removeFromSectionId, + path: path, + fileName: fileName, + download: download, + scopePath: scopePath, + recursionLevel: recursionLevel, + versionDescriptor: versionDescriptor, + includeContent: includeContent, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.replace(url, group, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -36661,31 +38158,29 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Removes a group from the work item form. + * Get items under a label. * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} pageId - The ID of the page the group is in - * @param {string} sectionId - The ID of the section to the group is in - * @param {string} groupId - The ID of the group + * @param {string} labelId - Unique identifier of label + * @param {number} top - Max number of items to return + * @param {number} skip - Number of items to skip */ - removeGroup(processId, witRefName, pageId, sectionId, groupId) { + getLabelItems(labelId, top, skip) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId, - sectionId: sectionId, - groupId: groupId + labelId: labelId + }; + let queryValues = { + '$top': top, + '$skip': skip, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "06166e34-de17-4b60-8cd1-23182a346fda", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, true); resolve(ret); } catch (err) { @@ -36695,32 +38190,32 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Updates a group in the work item form. + * Get a single deep label. * - * @param {WorkItemTrackingProcessInterfaces.Group} group - The updated group. - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} pageId - The ID of the page the group is in. - * @param {string} sectionId - The ID of the section the group is in. - * @param {string} groupId - The ID of the group. + * @param {string} labelId - Unique identifier of label + * @param {TfvcInterfaces.TfvcLabelRequestData} requestData - maxItemCount + * @param {string} project - Project ID or project name */ - updateGroup(group, processId, witRefName, pageId, sectionId, groupId) { + getLabel(labelId, requestData, project) { return __awaiter(this, void 0, void 0, function* () { + if (requestData == null) { + throw new TypeError('requestData can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId, - sectionId: sectionId, - groupId: groupId + project: project, + labelId: labelId + }; + let queryValues = { + requestData: requestData, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "a5d9bd7f-b661-4d0e-b9be-d9c16affae54", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, group, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcLabel, false); resolve(ret); } catch (err) { @@ -36730,25 +38225,34 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Gets the form layout. + * Get a collection of shallow label references. * - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. + * @param {TfvcInterfaces.TfvcLabelRequestData} requestData - labelScope, name, owner, and itemLabelFilter + * @param {string} project - Project ID or project name + * @param {number} top - Max number of labels to return, defaults to 100 when undefined + * @param {number} skip - Number of labels to skip */ - getFormLayout(processId, witRefName) { + getLabels(requestData, project, top, skip) { return __awaiter(this, void 0, void 0, function* () { + if (requestData == null) { + throw new TypeError('requestData can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName + project: project + }; + let queryValues = { + requestData: requestData, + '$top': top, + '$skip': skip, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "fa8646eb-43cd-4b71-9564-40106fd63e40", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "a5d9bd7f-b661-4d0e-b9be-d9c16affae54", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.FormLayout, false); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcLabelRef, true); resolve(ret); } catch (err) { @@ -36758,21 +38262,31 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Creates a picklist. + * Get changes included in a shelveset. * - * @param {WorkItemTrackingProcessInterfaces.PickList} picklist - Picklist + * @param {string} shelvesetId - Shelveset's unique ID + * @param {number} top - Max number of changes to return + * @param {number} skip - Number of changes to skip */ - createList(picklist) { + getShelvesetChanges(shelvesetId, top, skip) { return __awaiter(this, void 0, void 0, function* () { + if (shelvesetId == null) { + throw new TypeError('shelvesetId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; + let queryValues = { + shelvesetId: shelvesetId, + '$top': top, + '$skip': skip, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "dbaf075b-0445-4c34-9e5b-82292f856522", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, picklist, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChange, true); resolve(ret); } catch (err) { @@ -36782,23 +38296,29 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Removes a picklist. + * Get a single deep shelveset. * - * @param {string} listId - The ID of the list + * @param {string} shelvesetId - Shelveset's unique ID + * @param {TfvcInterfaces.TfvcShelvesetRequestData} requestData - includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength */ - deleteList(listId) { + getShelveset(shelvesetId, requestData) { return __awaiter(this, void 0, void 0, function* () { + if (shelvesetId == null) { + throw new TypeError('shelvesetId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - listId: listId + let routeValues = {}; + let queryValues = { + shelvesetId: shelvesetId, + requestData: requestData, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "e36d44fb-e907-4b0a-b194-f83f1ed32ad3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcShelveset, false); resolve(ret); } catch (err) { @@ -36808,23 +38328,28 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns a picklist. + * Return a collection of shallow shelveset references. * - * @param {string} listId - The ID of the list + * @param {TfvcInterfaces.TfvcShelvesetRequestData} requestData - name, owner, and maxCommentLength + * @param {number} top - Max number of shelvesets to return + * @param {number} skip - Number of shelvesets to skip */ - getList(listId) { + getShelvesets(requestData, top, skip) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - listId: listId + let routeValues = {}; + let queryValues = { + requestData: requestData, + '$top': top, + '$skip': skip, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "e36d44fb-e907-4b0a-b194-f83f1ed32ad3", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcShelvesetRef, true); resolve(ret); } catch (err) { @@ -36834,15 +38359,22 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns meta data of the picklist. + * Get work items associated with a shelveset. * + * @param {string} shelvesetId - Shelveset's unique ID */ - getListsMetadata() { + getShelvesetWorkItems(shelvesetId) { return __awaiter(this, void 0, void 0, function* () { + if (shelvesetId == null) { + throw new TypeError('shelvesetId can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = {}; + let queryValues = { + shelvesetId: shelvesetId, + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "a7a0c1c1-373e-425a-b031-a519474d743d", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -36857,23 +38389,26 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Updates a list. + * Provides File Count and Uncompressed Bytes for a Collection/Project at a particular scope for TFVC. * - * @param {WorkItemTrackingProcessInterfaces.PickList} picklist - * @param {string} listId - The ID of the list + * @param {string} project - Project ID or project name + * @param {string} scopePath - '$/' for collection, '$/project' for specific project */ - updateList(picklist, listId) { + getTfvcStatistics(project, scopePath) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - listId: listId + project: project + }; + let queryValues = { + scopePath: scopePath, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "e15c74c0-3605-40e0-aed4-4cc61e549ed8", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, picklist, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -36883,280 +38418,483 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { })); }); } - /** - * Adds a page to the work item form. - * - * @param {WorkItemTrackingProcessInterfaces.Page} page - The page. - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - */ - addPage(page, processId, witRefName) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "1cc7b29f-6697-4d9d-b0a1-2650d3e1d584", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, page, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.Page, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); - }); +} +exports.TfvcApi = TfvcApi; +TfvcApi.RESOURCE_AREA_ID = "8aa40520-446d-40e6-89f6-9c9f9ce44c48"; + + +/***/ }), + +/***/ 9686: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +//******************************************************************************************************* +// significant portions of this file copied from: VSO\src\Vssf\WebPlatform\Platform\Scripts\VSS\WebApi\RestClient.ts +//******************************************************************************************************* +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VsoClient = exports.InvalidApiResourceVersionError = void 0; +/// Imports of 3rd Party /// +const url = __nccwpck_require__(7310); +const path = __nccwpck_require__(1017); +class InvalidApiResourceVersionError { + constructor(message) { + this.name = "Invalid resource version"; + this.message = message; } - /** - * Removes a page from the work item form - * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} pageId - The ID of the page - */ - removePage(processId, witRefName, pageId) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "1cc7b29f-6697-4d9d-b0a1-2650d3e1d584", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); - }); +} +exports.InvalidApiResourceVersionError = InvalidApiResourceVersionError; +/** + * Base class that should be used (derived from) to make requests to VSS REST apis + */ +class VsoClient { + constructor(baseUrl, restClient) { + this.baseUrl = baseUrl; + this.basePath = url.parse(baseUrl).pathname; + this.restClient = restClient; + this._locationsByAreaPromises = {}; + this._initializationPromise = Promise.resolve(true); } - /** - * Updates a page on the work item form - * - * @param {WorkItemTrackingProcessInterfaces.Page} page - The page - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - */ - updatePage(page, processId, witRefName) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "1cc7b29f-6697-4d9d-b0a1-2650d3e1d584", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.update(url, page, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.Page, false); - resolve(ret); - } - catch (err) { - reject(err); + autoNegotiateApiVersion(location, requestedVersion) { + let negotiatedVersion; + let apiVersion; + let apiVersionString; + if (requestedVersion) { + let apiVersionRegEx = new RegExp('(\\d+(\\.\\d+)?)(-preview(\\.(\\d+))?)?'); + // Need to handle 3 types of api versions + invalid apiversion + // '2.1-preview.1' = ["2.1-preview.1", "2.1", ".1", -preview.1", ".1", "1"] + // '2.1-preview' = ["2.1-preview", "2.1", ".1", "-preview", undefined, undefined] + // '2.1' = ["2.1", "2.1", ".1", undefined, undefined, undefined] + let isPreview = false; + let resourceVersion; + let regExExecArray = apiVersionRegEx.exec(requestedVersion); + if (regExExecArray) { + if (regExExecArray[1]) { + // we have an api version + apiVersion = +regExExecArray[1]; + apiVersionString = regExExecArray[1]; + if (regExExecArray[3]) { + // requesting preview + isPreview = true; + if (regExExecArray[5]) { + // we have a resource version + resourceVersion = +regExExecArray[5]; + } + } + // compare the location version and requestedversion + if (apiVersion <= +location.releasedVersion + || (!resourceVersion && apiVersion <= +location.maxVersion && isPreview) + || (resourceVersion && apiVersion <= +location.maxVersion && resourceVersion <= +location.resourceVersion)) { + negotiatedVersion = requestedVersion; + } + // else fall back to latest version of the resource from location } - })); - }); + } + } + if (!negotiatedVersion) { + // Use the latest version of the resource if the api version was not specified in the request or if the requested version is higher then the location's supported version + if (apiVersion < +location.maxVersion) { + negotiatedVersion = apiVersionString + "-preview"; + } + else if (location.maxVersion === location.releasedVersion) { + negotiatedVersion = location.maxVersion; + } + else { + negotiatedVersion = location.maxVersion + "-preview." + location.resourceVersion; + } + } + return negotiatedVersion; } /** - * Creates a process. - * - * @param {WorkItemTrackingProcessInterfaces.CreateProcessModel} createRequest - CreateProcessModel. + * Gets the route template for a resource based on its location ID and negotiates the api version */ - createNewProcess(createRequest) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, createRequest, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); + getVersioningData(apiVersion, area, locationId, routeValues, queryParams) { + let requestUrl; + return this.beginGetLocation(area, locationId) + .then((location) => { + if (!location) { + throw new Error("Failed to find api location for area: " + area + " id: " + locationId); + } + apiVersion = this.autoNegotiateApiVersion(location, apiVersion); + requestUrl = this.getRequestUrl(location.routeTemplate, location.area, location.resourceName, routeValues, queryParams); + return { + apiVersion: apiVersion, + requestUrl: requestUrl + }; }); } /** - * Removes a process of a specific ID. - * - * @param {string} processTypeId + * Sets a promise that is waited on before any requests are issued. Can be used to asynchronously + * set the request url and auth token manager. */ - deleteProcessById(processTypeId) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processTypeId: processTypeId - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); - }); + _setInitializationPromise(promise) { + if (promise) { + this._initializationPromise = promise; + } } /** - * Edit a process of a specific ID. + * Gets information about an API resource location (route template, supported versions, etc.) * - * @param {WorkItemTrackingProcessInterfaces.UpdateProcessModel} updateRequest - * @param {string} processTypeId + * @param area resource area name + * @param locationId Guid of the location to get */ - editProcess(updateRequest, processTypeId) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processTypeId: processTypeId - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.update(url, updateRequest, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); + beginGetLocation(area, locationId) { + return this._initializationPromise.then(() => { + return this.beginGetAreaLocations(area); + }).then((areaLocations) => { + return areaLocations[(locationId || "").toLowerCase()]; }); } - /** - * Get list of all processes including system and inherited. - * - * @param {WorkItemTrackingProcessInterfaces.GetProcessExpandLevel} expand - */ - getListOfProcesses(expand) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; - let queryValues = { - '$expand': expand, - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues, queryValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, true); - resolve(ret); + beginGetAreaLocations(area) { + let areaLocationsPromise = this._locationsByAreaPromises[area]; + if (!areaLocationsPromise) { + let requestUrl = this.resolveUrl(VsoClient.APIS_RELATIVE_PATH + "/" + area); + areaLocationsPromise = this.restClient.options(requestUrl) + .then((res) => { + if (!res.result) { + return {}; } - catch (err) { - reject(err); + let locationsLookup = {}; + let resourceLocations = res.result.value; + let i; + for (i = 0; i < resourceLocations.length; i++) { + let resourceLocation = resourceLocations[i]; + locationsLookup[resourceLocation.id.toLowerCase()] = resourceLocation; } - })); - }); + // If we have completed successfully, cache the response. + this._locationsByAreaPromises[area] = areaLocationsPromise; + return locationsLookup; + }); + } + return areaLocationsPromise; } - /** - * Get a single process of a specified ID. - * - * @param {string} processTypeId - * @param {WorkItemTrackingProcessInterfaces.GetProcessExpandLevel} expand - */ - getProcessByItsId(processTypeId, expand) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processTypeId: processTypeId - }; - let queryValues = { - '$expand': expand, - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues, queryValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, false); - resolve(ret); + resolveUrl(relativeUrl) { + return url.resolve(this.baseUrl, path.join(this.basePath, relativeUrl)); + } + queryParamsToStringHelper(queryParams, prefix) { + if (queryParams == null || queryParams.length === 0) { + return ''; + } + let queryString = ''; + if (Array.isArray(queryParams)) { + // Remove trailing '.' from prefix if it exists, otherwise use the prefix as-is + const paramName = prefix.endsWith('.') ? prefix.slice(0, -1) : prefix; + const values = queryParams.map(value => value.toString()).join(','); + queryString += paramName + '=' + encodeURIComponent(values) + '&'; + return queryString; + } + if (typeof (queryParams) !== 'string') { + for (let property in queryParams) { + if (queryParams.hasOwnProperty(property)) { + const prop = queryParams[property]; + const newPrefix = prefix + encodeURIComponent(property.toString()) + '.'; + queryString += this.queryParamsToStringHelper(prop, newPrefix); } - catch (err) { - reject(err); + } + } + if (queryString === '' && prefix.length > 0) { + // Date.prototype.toString() returns a string that is not valid for the REST API. + // Need to specially call `toUTCString()` instead for such cases + const queryValue = typeof queryParams === 'object' && 'toUTCString' in queryParams ? queryParams.toUTCString() : queryParams.toString(); + // Will always need to chop period off of end of prefix, if it exists + const paramName = prefix.endsWith('.') ? prefix.slice(0, -1) : prefix; + queryString = paramName + '=' + encodeURIComponent(queryValue) + '&'; + } + return queryString; + } + queryParamsToString(queryParams) { + const queryString = '?' + this.queryParamsToStringHelper(queryParams, ''); + // Will always need to slice either a ? or & off of the end + return queryString.slice(0, -1); + } + getRequestUrl(routeTemplate, area, resource, routeValues, queryParams) { + // Add area/resource route values (based on the location) + routeValues = routeValues || {}; + if (!routeValues.area) { + routeValues.area = area; + } + if (!routeValues.resource) { + routeValues.resource = resource; + } + // Replace templated route values + let relativeUrl = this.replaceRouteValues(routeTemplate, routeValues); + // Append query parameters to the end + if (queryParams) { + relativeUrl += this.queryParamsToString(queryParams); + } + // Resolve the relative url with the base + return url.resolve(this.baseUrl, path.join(this.basePath, relativeUrl)); + } + // helper method copied directly from VSS\WebAPI\restclient.ts + replaceRouteValues(routeTemplate, routeValues) { + let result = "", currentPathPart = "", paramName = "", insideParam = false, charIndex, routeTemplateLength = routeTemplate.length, c; + for (charIndex = 0; charIndex < routeTemplateLength; charIndex++) { + c = routeTemplate[charIndex]; + if (insideParam) { + if (c == "}") { + insideParam = false; + if (routeValues[paramName]) { + currentPathPart += encodeURIComponent(routeValues[paramName]); + } + else { + // Normalize param name in order to capture wild-card routes + let strippedParamName = paramName.replace(/[^a-z0-9]/ig, ''); + if (routeValues[strippedParamName]) { + currentPathPart += encodeURIComponent(routeValues[strippedParamName]); + } + } + paramName = ""; } - })); - }); + else { + paramName += c; + } + } + else { + if (c == "/") { + if (currentPathPart) { + if (result) { + result += "/"; + } + result += currentPathPart; + currentPathPart = ""; + } + } + else if (c == "{") { + if ((charIndex + 1) < routeTemplateLength && routeTemplate[charIndex + 1] == "{") { + // Escaped '{' + currentPathPart += c; + charIndex++; + } + else { + insideParam = true; + } + } + else if (c == '}') { + currentPathPart += c; + if ((charIndex + 1) < routeTemplateLength && routeTemplate[charIndex + 1] == "}") { + // Escaped '}' + charIndex++; + } + } + else { + currentPathPart += c; + } + } + } + if (currentPathPart) { + if (result) { + result += "/"; + } + result += currentPathPart; + } + return result; } - /** - * Adds a rule to work item type in the process. - * - * @param {WorkItemTrackingProcessInterfaces.CreateProcessRuleRequest} processRuleCreate - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type +} +exports.VsoClient = VsoClient; +VsoClient.APIS_RELATIVE_PATH = "_apis"; +VsoClient.PREVIEW_INDICATOR = "-preview."; + + +/***/ }), + +/***/ 7967: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WebApi = exports.getHandlerFromToken = exports.getPersonalAccessTokenHandler = exports.getBearerHandler = exports.getNtlmHandler = exports.getBasicHandler = void 0; +const alertm = __nccwpck_require__(7770); +const buildm = __nccwpck_require__(9893); +const corem = __nccwpck_require__(4020); +const dashboardm = __nccwpck_require__(7539); +const extmgmtm = __nccwpck_require__(4605); +const featuremgmtm = __nccwpck_require__(3193); +const filecontainerm = __nccwpck_require__(7558); +const gallerym = __nccwpck_require__(1939); +const gitm = __nccwpck_require__(4996); +const locationsm = __nccwpck_require__(4771); +const managementm = __nccwpck_require__(2190); +const notificationm = __nccwpck_require__(8221); +const policym = __nccwpck_require__(266); +const profilem = __nccwpck_require__(8101); +const projectm = __nccwpck_require__(1682); +const releasem = __nccwpck_require__(3075); +const securityrolesm = __nccwpck_require__(806); +const taskagentm = __nccwpck_require__(5899); +const taskm = __nccwpck_require__(2354); +const testm = __nccwpck_require__(5742); +const testplanm = __nccwpck_require__(8737); +const testresultsm = __nccwpck_require__(1819); +const tfvcm = __nccwpck_require__(5417); +const wikim = __nccwpck_require__(6391); +const workm = __nccwpck_require__(8186); +const pipelinesm = __nccwpck_require__(686); +const cixm = __nccwpck_require__(463); +const workitemtrackingm = __nccwpck_require__(8409); +const workitemtrackingprocessm = __nccwpck_require__(1178); +const workitemtrackingprocessdefinitionm = __nccwpck_require__(3333); +const basicm = __nccwpck_require__(6456); +const bearm = __nccwpck_require__(1141); +const ntlmm = __nccwpck_require__(3450); +const patm = __nccwpck_require__(4551); +const rm = __nccwpck_require__(7405); +const vsom = __nccwpck_require__(9686); +const crypto = __nccwpck_require__(6113); +const fs = __nccwpck_require__(7147); +const os = __nccwpck_require__(2037); +const url = __nccwpck_require__(7310); +const path = __nccwpck_require__(1017); +const isBrowser = typeof window !== 'undefined'; +const personalAccessTokenRegex = new RegExp('^.{76}AZDO.{4}$'); +/** + * Methods to return handler objects (see handlers folder) + */ +function getBasicHandler(username, password, allowCrossOriginAuthentication) { + return new basicm.BasicCredentialHandler(username, password, allowCrossOriginAuthentication); +} +exports.getBasicHandler = getBasicHandler; +function getNtlmHandler(username, password, workstation, domain) { + return new ntlmm.NtlmCredentialHandler(username, password, workstation, domain); +} +exports.getNtlmHandler = getNtlmHandler; +function getBearerHandler(token, allowCrossOriginAuthentication) { + return new bearm.BearerCredentialHandler(token, allowCrossOriginAuthentication); +} +exports.getBearerHandler = getBearerHandler; +function getPersonalAccessTokenHandler(token, allowCrossOriginAuthentication) { + return new patm.PersonalAccessTokenCredentialHandler(token, allowCrossOriginAuthentication); +} +exports.getPersonalAccessTokenHandler = getPersonalAccessTokenHandler; +function getHandlerFromToken(token, allowCrossOriginAuthentication) { + if (token.length === 52 || personalAccessTokenRegex.test(token)) { + return getPersonalAccessTokenHandler(token, allowCrossOriginAuthentication); + } + else { + return getBearerHandler(token, allowCrossOriginAuthentication); + } +} +exports.getHandlerFromToken = getHandlerFromToken; +; +// --------------------------------------------------------------------------- +// Factory to return client apis +// When new APIs are added, a method must be added here to instantiate the API +//---------------------------------------------------------------------------- +class WebApi { + /* + * Factory to return client apis and handlers + * @param defaultUrl default server url to use when creating new apis from factory methods + * @param authHandler default authentication credentials to use when creating new apis from factory methods */ - addProcessWorkItemTypeRule(processRuleCreate, processId, witRefName) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, processRuleCreate, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, false); - resolve(ret); - } - catch (err) { - reject(err); + constructor(defaultUrl, authHandler, options, requestSettings) { + /** + * Determines if the domain is exluded for proxy via the no_proxy env var + * @param url: the server url + */ + this.isNoProxyHost = function (_url) { + if (!process.env.no_proxy) { + return false; + } + const noProxyDomains = (process.env.no_proxy || '') + .split(',') + .map(v => v.toLowerCase()); + const serverUrl = url.parse(_url).host.toLowerCase(); + // return true if the no_proxy includes the host + return noProxyDomains.indexOf(serverUrl) !== -1; + }; + this.serverUrl = defaultUrl; + this.authHandler = authHandler; + this.options = options || {}; + if (!this.isNoProxyHost(this.serverUrl)) { + // try to get proxy setting from environment variable set by VSTS-Task-Lib if there is no proxy setting in the options + if (!this.options.proxy || !this.options.proxy.proxyUrl) { + if (global['_vsts_task_lib_proxy']) { + let proxyFromEnv = { + proxyUrl: global['_vsts_task_lib_proxy_url'], + proxyUsername: global['_vsts_task_lib_proxy_username'], + proxyPassword: this._readTaskLibSecrets(global['_vsts_task_lib_proxy_password']), + proxyBypassHosts: JSON.parse(global['_vsts_task_lib_proxy_bypass'] || "[]"), + }; + this.options.proxy = proxyFromEnv; } - })); - }); + } + } + // try get cert setting from environment variable set by VSTS-Task-Lib if there is no cert setting in the options + if (!this.options.cert) { + if (global['_vsts_task_lib_cert']) { + let certFromEnv = { + caFile: global['_vsts_task_lib_cert_ca'], + certFile: global['_vsts_task_lib_cert_clientcert'], + keyFile: global['_vsts_task_lib_cert_key'], + passphrase: this._readTaskLibSecrets(global['_vsts_task_lib_cert_passphrase']), + }; + this.options.cert = certFromEnv; + } + } + // try get ignore SSL error setting from environment variable set by VSTS-Task-Lib if there is no ignore SSL error setting in the options + if (!this.options.ignoreSslError) { + this.options.ignoreSslError = !!global['_vsts_task_lib_skip_cert_validation']; + } + let userAgent; + const nodeApiName = 'azure-devops-node-api'; + if (requestSettings && requestSettings.userAgent) { + userAgent = requestSettings.userAgent; + this.userAgent = requestSettings.userAgent; + } + else if (isBrowser) { + if (requestSettings) { + userAgent = `${requestSettings.productName}/${requestSettings.productVersion} (${nodeApiName}; ${window.navigator.userAgent})`; + } + else { + userAgent = `${nodeApiName} (${window.navigator.userAgent})`; + } + } + else { + let nodeApiVersion = 'unknown'; + const packageJsonPath = __nccwpck_require__.ab + "package.json"; + if (fs.existsSync(__nccwpck_require__.ab + "package.json")) { + nodeApiVersion = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')).version; + } + const osName = os.platform(); + const osVersion = os.release(); + if (requestSettings) { + userAgent = `${requestSettings.productName}/${requestSettings.productVersion} (${nodeApiName} ${nodeApiVersion}; ${osName} ${osVersion})`; + } + else { + userAgent = `${nodeApiName}/${nodeApiVersion} (${osName} ${osVersion})`; + } + } + this.rest = new rm.RestClient(userAgent, null, [this.authHandler], this.options); + this.vsoClient = new vsom.VsoClient(defaultUrl, this.rest); } /** - * Removes a rule from the work item type in the process. - * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} ruleId - The ID of the rule + * Convenience factory to create with a bearer token. + * @param defaultServerUrl default server url to use when creating new apis from factory methods + * @param defaultAuthHandler default authentication credentials to use when creating new apis from factory methods */ - deleteProcessWorkItemTypeRule(processId, witRefName, ruleId) { + static createWithBearerToken(defaultUrl, token, options) { + let bearerHandler = getBearerHandler(token); + return new this(defaultUrl, bearerHandler, options); + } + connect() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName, - ruleId: ruleId - }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + res = yield this.rest.get(this.vsoClient.resolveUrl('/_apis/connectionData')); + resolve(res.result); } catch (err) { reject(err); @@ -37165,203 +38903,363 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns a single rule in the work item type of the process. - * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} ruleId - The ID of the rule + * Each factory method can take a serverUrl and a list of handlers + * if these aren't provided, the default url and auth handler given to the constructor for this class will be used */ - getProcessWorkItemTypeRule(processId, witRefName, ruleId) { + getAlertApi(serverUrl, handlers) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName, - ruleId: ruleId - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "0f2ca920-f269-4545-b1f4-5b4173aa784e"); + handlers = handlers || [this.authHandler]; + return new alertm.AlertApi(serverUrl, handlers, this.options, this.userAgent); }); } - /** - * Returns a list of all rules in the work item type of the process. - * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - */ - getProcessWorkItemTypeRules(processId, witRefName) { + getBuildApi(serverUrl, handlers) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, true); - resolve(ret); - } - catch (err) { - reject(err); - } - })); + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, buildm.BuildApi.RESOURCE_AREA_ID); + handlers = handlers || [this.authHandler]; + return new buildm.BuildApi(serverUrl, handlers, this.options, this.userAgent); }); } - /** - * Updates a rule in the work item type of the process. - * - * @param {WorkItemTrackingProcessInterfaces.UpdateProcessRuleRequest} processRule - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} ruleId - The ID of the rule - */ - updateProcessWorkItemTypeRule(processRule, processId, witRefName, ruleId) { + getCoreApi(serverUrl, handlers) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName, - ruleId: ruleId - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.replace(url, processRule, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "79134c72-4a58-4b42-976c-04e7115f32bf"); + handlers = handlers || [this.authHandler]; + return new corem.CoreApi(serverUrl, handlers, this.options, this.userAgent); }); } - /** - * Creates a state definition in the work item type of the process. - * - * @param {WorkItemTrackingProcessInterfaces.WorkItemStateInputModel} stateModel - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - */ - createStateDefinition(stateModel, processId, witRefName) { + getDashboardApi(serverUrl, handlers) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, stateModel, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "31c84e0a-3ece-48fd-a29d-100849af99ba"); + handlers = handlers || [this.authHandler]; + return new dashboardm.DashboardApi(serverUrl, handlers, this.options, this.userAgent); }); } - /** - * Removes a state definition in the work item type of the process. - * - * @param {string} processId - ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} stateId - ID of the state - */ - deleteStateDefinition(processId, witRefName, stateId) { + getExtensionManagementApi(serverUrl, handlers) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName, - stateId: stateId - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); - } - catch (err) { - reject(err); - } - })); + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "6c2b0933-3600-42ae-bf8b-93d4f7e83594"); + handlers = handlers || [this.authHandler]; + return new extmgmtm.ExtensionManagementApi(serverUrl, handlers, this.options, this.userAgent); }); } - /** - * Returns a single state definition in a work item type of the process. - * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} stateId - The ID of the state - */ - getStateDefinition(processId, witRefName, stateId) { + getFeatureManagementApi(serverUrl, handlers) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = { - processId: processId, - witRefName: witRefName, - stateId: stateId - }; - try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); - let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false); - resolve(ret); - } - catch (err) { - reject(err); + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, ""); + handlers = handlers || [this.authHandler]; + return new featuremgmtm.FeatureManagementApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getFileContainerApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, ""); + handlers = handlers || [this.authHandler]; + return new filecontainerm.FileContainerApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getGalleryApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, gallerym.GalleryApi.RESOURCE_AREA_ID); + handlers = handlers || [this.authHandler]; + return new gallerym.GalleryApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getGitApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, gitm.GitApi.RESOURCE_AREA_ID); + handlers = handlers || [this.authHandler]; + return new gitm.GitApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + // TODO: Don't call resource area here? Will cause infinite loop? + getLocationsApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + let optionsClone = Object.assign({}, this.options); + optionsClone.allowRetries = true; + optionsClone.maxRetries = 5; + serverUrl = (yield serverUrl) || this.serverUrl; + handlers = handlers || [this.authHandler]; + return new locationsm.LocationsApi(serverUrl, handlers, optionsClone, this.userAgent); + }); + } + getManagementApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "f101720c-9790-45a6-9fb3-494a09fddeeb"); + handlers = handlers || [this.authHandler]; + return new managementm.ManagementApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getNotificationApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, ""); + handlers = handlers || [this.authHandler]; + return new notificationm.NotificationApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getPolicyApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "fb13a388-40dd-4a04-b530-013a739c72ef"); + handlers = handlers || [this.authHandler]; + return new policym.PolicyApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getProfileApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "8ccfef3d-2b87-4e99-8ccb-66e343d2daa8"); + handlers = handlers || [this.authHandler]; + return new profilem.ProfileApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getProjectAnalysisApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "7658fa33-b1bf-4580-990f-fac5896773d3"); + handlers = handlers || [this.authHandler]; + return new projectm.ProjectAnalysisApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getSecurityRolesApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, ""); + handlers = handlers || [this.authHandler]; + return new securityrolesm.SecurityRolesApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getReleaseApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "efc2f575-36ef-48e9-b672-0c6fb4a48ac5"); + handlers = handlers || [this.authHandler]; + return new releasem.ReleaseApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getTaskApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, ""); + handlers = handlers || [this.authHandler]; + return new taskm.TaskApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getTaskAgentApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "a85b8835-c1a1-4aac-ae97-1c3d0ba72dbd"); + handlers = handlers || [this.authHandler]; + return new taskagentm.TaskAgentApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getTestApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "c2aa639c-3ccc-4740-b3b6-ce2a1e1d984e"); + handlers = handlers || [this.authHandler]; + return new testm.TestApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getTestPlanApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "e4c27205-9d23-4c98-b958-d798bc3f9cd4"); + handlers = handlers || [this.authHandler]; + return new testplanm.TestPlanApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getTestResultsApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "c83eaf52-edf3-4034-ae11-17d38f25404c"); + handlers = handlers || [this.authHandler]; + return new testresultsm.TestResultsApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getTfvcApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "8aa40520-446d-40e6-89f6-9c9f9ce44c48"); + handlers = handlers || [this.authHandler]; + return new tfvcm.TfvcApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getWikiApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "bf7d82a0-8aa5-4613-94ef-6172a5ea01f3"); + handlers = handlers || [this.authHandler]; + return new wikim.WikiApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getWorkApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "1d4f49f9-02b9-4e26-b826-2cdb6195f2a9"); + handlers = handlers || [this.authHandler]; + return new workm.WorkApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getWorkItemTrackingApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, workitemtrackingm.WorkItemTrackingApi.RESOURCE_AREA_ID); + handlers = handlers || [this.authHandler]; + return new workitemtrackingm.WorkItemTrackingApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getWorkItemTrackingProcessApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "5264459e-e5e0-4bd8-b118-0985e68a4ec5"); + handlers = handlers || [this.authHandler]; + return new workitemtrackingprocessm.WorkItemTrackingProcessApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getWorkItemTrackingProcessDefinitionApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "5264459e-e5e0-4bd8-b118-0985e68a4ec5"); + handlers = handlers || [this.authHandler]; + return new workitemtrackingprocessdefinitionm.WorkItemTrackingProcessDefinitionsApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getPipelinesApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "5264459e-e5e0-4bd8-b118-0985e68a4ec5"); + handlers = handlers || [this.authHandler]; + return new pipelinesm.PipelinesApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + getCixApi(serverUrl, handlers) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Load RESOURCE_AREA_ID correctly. + serverUrl = yield this._getResourceAreaUrl(serverUrl || this.serverUrl, "5264459e-e5e0-4bd8-b118-0985e68a4ec5"); + handlers = handlers || [this.authHandler]; + return new cixm.CixApi(serverUrl, handlers, this.options, this.userAgent); + }); + } + _getResourceAreaUrl(serverUrl, resourceId) { + return __awaiter(this, void 0, void 0, function* () { + if (!resourceId) { + return serverUrl; + } + // This must be of type any, see comment just below. + const resourceAreas = yield this._getResourceAreas(); + if (resourceAreas === undefined) { + throw new Error((`Failed to retrieve resource areas ' + 'from server: ${serverUrl}`)); + } + // The response type differs based on whether or not there are resource areas. When we are on prem we get: + // {"count":0,"value":null} and when we are on VSTS we get an array of resource areas. + // Due to this strangeness the type of resourceAreas needs to be any and we need to check .count + // When going against vsts count will be undefined. On prem it will be 0 + if (!resourceAreas || resourceAreas.length === 0 || resourceAreas.count === 0) { + // For on prem environments we get an empty list + return serverUrl; + } + for (var resourceArea of resourceAreas) { + if (resourceArea.id.toLowerCase() === resourceId.toLowerCase()) { + return resourceArea.locationUrl; } - })); + } + throw new Error((`Could not find information for resource area ${resourceId} ' + 'from server: ${serverUrl}`)); + }); + } + _getResourceAreas() { + return __awaiter(this, void 0, void 0, function* () { + if (!this._resourceAreas) { + const locationClient = yield this.getLocationsApi(); + this._resourceAreas = yield locationClient.getResourceAreas(); + } + return this._resourceAreas; }); } + _readTaskLibSecrets(lookupKey) { + if (isBrowser) { + throw new Error("Browsers can't securely keep secrets"); + } + // the lookupKey should has following format + // base64encoded:base64encoded + if (lookupKey && lookupKey.indexOf(':') > 0) { + let lookupInfo = lookupKey.split(':', 2); + // file contains encryption key + let keyFile = new Buffer(lookupInfo[0], 'base64').toString('utf8'); + let encryptKey = new Buffer(fs.readFileSync(keyFile, 'utf8'), 'base64'); + let encryptedContent = new Buffer(lookupInfo[1], 'base64').toString('utf8'); + let decipher = crypto.createDecipher("aes-256-ctr", encryptKey); + let decryptedContent = decipher.update(encryptedContent, 'hex', 'utf8'); + decryptedContent += decipher.final('utf8'); + return decryptedContent; + } + } +} +exports.WebApi = WebApi; + + +/***/ }), + +/***/ 6391: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WikiApi = void 0; +const basem = __nccwpck_require__(273); +const Comments_Contracts = __nccwpck_require__(4743); +const WikiInterfaces = __nccwpck_require__(5787); +class WikiApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Wiki-api', options); + } /** - * Returns a list of all state definitions in a work item type of the process. + * Uploads an attachment on a comment on a wiki page. * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type + * @param {NodeJS.ReadableStream} contentStream - Content to upload + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {number} pageId - Wiki page ID. */ - getStateDefinitions(processId, witRefName) { + createCommentAttachment(customHeaders, contentStream, project, wikiIdentifier, pageId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "application/octet-stream"; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "5100d976-363d-42e7-a19d-4171ecb44782", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, true); + res = yield this.rest.uploadStream("POST", url, contentStream, options); + let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.CommentAttachment, false); resolve(ret); } catch (err) { @@ -37371,29 +39269,28 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Hides a state definition in the work item type of the process.Only states with customizationType:System can be hidden. + * Downloads an attachment on a comment on a wiki page. * - * @param {WorkItemTrackingProcessInterfaces.HideStateModel} hideStateModel - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} stateId - The ID of the state + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {number} pageId - Wiki page ID. + * @param {string} attachmentId - Attachment ID. */ - hideStateDefinition(hideStateModel, processId, witRefName, stateId) { + getAttachmentContent(project, wikiIdentifier, pageId, attachmentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - stateId: stateId + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId, + attachmentId: attachmentId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "5100d976-363d-42e7-a19d-4171ecb44782", routeValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.replace(url, hideStateModel, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -37402,28 +39299,31 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Updates a given state definition in the work item type of the process. + * Add a reaction on a wiki page comment. * - * @param {WorkItemTrackingProcessInterfaces.WorkItemStateInputModel} stateModel - * @param {string} processId - ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} stateId - ID of the state + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name + * @param {number} pageId - Wiki page ID + * @param {number} commentId - ID of the associated comment + * @param {Comments_Contracts.CommentReactionType} type - Type of the reaction being added */ - updateStateDefinition(stateModel, processId, witRefName, stateId) { + addCommentReaction(project, wikiIdentifier, pageId, commentId, type) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - stateId: stateId + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId, + commentId: commentId, + type: type }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "7a5bc693-aab7-4d48-8f34-36f373022063", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, stateModel, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false); + res = yield this.rest.replace(url, null, options); + let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.CommentReaction, false); resolve(ret); } catch (err) { @@ -37433,27 +39333,31 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Deletes a system control modification on the work item form. + * Delete a reaction on a wiki page comment. * - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} controlId - The ID of the control. + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or name + * @param {number} pageId - Wiki page ID + * @param {number} commentId - ID of the associated comment + * @param {Comments_Contracts.CommentReactionType} type - Type of the reaction being deleted */ - deleteSystemControl(processId, witRefName, controlId) { + deleteCommentReaction(project, wikiIdentifier, pageId, commentId, type) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - controlId: controlId + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId, + commentId: commentId, + type: type }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "ff9a3d2c-32b7-4c6c-991c-d5a251fb9098", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "7a5bc693-aab7-4d48-8f34-36f373022063", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.CommentReaction, false); resolve(ret); } catch (err) { @@ -37463,20 +39367,32 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Gets edited system controls for a work item type in a process. To get all system controls (base + edited) use layout API(s) + * Gets a list of users who have reacted for the given wiki comment with a given reaction type. Supports paging, with a default page size of 100 users at a time. * - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {number} pageId - Wiki page ID. + * @param {number} commentId - ID of the associated comment + * @param {Comments_Contracts.CommentReactionType} type - Type of the reaction for which the engaged users are being requested + * @param {number} top - Number of enagaged users to be returned in a given page. Optional, defaults to 100 + * @param {number} skip - Number of engaged users to be skipped to page the next set of engaged users, defaults to 0 */ - getSystemControls(processId, witRefName) { + getEngagedUsers(project, wikiIdentifier, pageId, commentId, type, top, skip) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId, + commentId: commentId, + type: type + }; + let queryValues = { + '$top': top, + '$skip': skip, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "ff9a3d2c-32b7-4c6c-991c-d5a251fb9098", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "598a5268-41a7-4162-b7dc-344131e4d1fa", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -37491,28 +39407,28 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Updates/adds a system control on the work item form. + * Add a comment on a wiki page. * - * @param {WorkItemTrackingProcessInterfaces.Control} control - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. - * @param {string} controlId - The ID of the control. + * @param {Comments_Contracts.CommentCreateParameters} request - Comment create request. + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {number} pageId - Wiki page ID. */ - updateSystemControl(control, processId, witRefName, controlId) { + addComment(request, project, wikiIdentifier, pageId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - controlId: controlId + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "ff9a3d2c-32b7-4c6c-991c-d5a251fb9098", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "9b394e93-7db5-46cb-9c26-09a36aa5c895", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, control, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, request, options); + let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.Comment, false); resolve(ret); } catch (err) { @@ -37522,24 +39438,29 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Creates a work item type in the process. + * Delete a comment on a wiki page. * - * @param {WorkItemTrackingProcessInterfaces.CreateProcessWorkItemTypeRequest} workItemType - * @param {string} processId - The ID of the process on which to create work item type. + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or name. + * @param {number} pageId - Wiki page ID. + * @param {number} id - Comment ID. */ - createProcessWorkItemType(workItemType, processId) { + deleteComment(project, wikiIdentifier, pageId, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "9b394e93-7db5-46cb-9c26-09a36aa5c895", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, workItemType, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -37549,25 +39470,35 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Removes a work itewm type in the process. + * Returns a comment associated with the Wiki Page. * - * @param {string} processId - The ID of the process. - * @param {string} witRefName - The reference name of the work item type. + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {number} pageId - Wiki page ID. + * @param {number} id - ID of the comment to return. + * @param {boolean} excludeDeleted - Specify if the deleted comment should be skipped. + * @param {Comments_Contracts.CommentExpandOptions} expand - Specifies the additional data retrieval options for comments. */ - deleteProcessWorkItemType(processId, witRefName) { + getComment(project, wikiIdentifier, pageId, id, excludeDeleted, expand) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId, + id: id + }; + let queryValues = { + excludeDeleted: excludeDeleted, + '$expand': expand, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "9b394e93-7db5-46cb-9c26-09a36aa5c895", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.Comment, false); resolve(ret); } catch (err) { @@ -37577,29 +39508,41 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns a single work item type in a process. + * Returns a pageable list of comments. * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {WorkItemTrackingProcessInterfaces.GetWorkItemTypeExpand} expand - Flag to determine what properties of work item type to return + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {number} pageId - Wiki page ID. + * @param {number} top - Max number of comments to return. + * @param {string} continuationToken - Used to query for the next page of comments. + * @param {boolean} excludeDeleted - Specify if the deleted comments should be skipped. + * @param {Comments_Contracts.CommentExpandOptions} expand - Specifies the additional data retrieval options for comments. + * @param {Comments_Contracts.CommentSortOrder} order - Order in which the comments should be returned. + * @param {number} parentId - CommentId of the parent comment. */ - getProcessWorkItemType(processId, witRefName, expand) { + listComments(project, wikiIdentifier, pageId, top, continuationToken, excludeDeleted, expand, order, parentId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId }; let queryValues = { + '$top': top, + continuationToken: continuationToken, + excludeDeleted: excludeDeleted, '$expand': expand, + order: order, + parentId: parentId, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "9b394e93-7db5-46cb-9c26-09a36aa5c895", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, false); + let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.CommentList, false); resolve(ret); } catch (err) { @@ -37609,27 +39552,30 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns a list of all work item types in a process. + * Update a comment on a wiki page. * - * @param {string} processId - The ID of the process - * @param {WorkItemTrackingProcessInterfaces.GetWorkItemTypeExpand} expand - Flag to determine what properties of work item type to return + * @param {Comments_Contracts.CommentUpdateParameters} comment - Comment update request. + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {number} pageId - Wiki page ID. + * @param {number} id - Comment ID. */ - getProcessWorkItemTypes(processId, expand) { + updateComment(comment, project, wikiIdentifier, pageId, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId - }; - let queryValues = { - '$expand': expand, + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "9b394e93-7db5-46cb-9c26-09a36aa5c895", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, true); + res = yield this.rest.update(url, comment, options); + let ret = this.formatResponse(res.result, Comments_Contracts.TypeInfo.Comment, false); resolve(ret); } catch (err) { @@ -37639,27 +39585,34 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Updates a work item type of the process. + * Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. * - * @param {WorkItemTrackingProcessInterfaces.UpdateProcessWorkItemTypeRequest} workItemTypeUpdate - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {string} path - Wiki page path. + * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional). + * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - GitVersionDescriptor for the page. Defaults to the default branch (Optional). + * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional) */ - updateProcessWorkItemType(workItemTypeUpdate, processId, witRefName) { + getPageText(project, wikiIdentifier, path, recursionLevel, versionDescriptor, includeContent) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + wikiIdentifier: wikiIdentifier + }; + let queryValues = { + path: path, + recursionLevel: recursionLevel, + versionDescriptor: versionDescriptor, + includeContent: includeContent, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.update(url, workItemTypeUpdate, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -37668,27 +39621,34 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Adds a behavior to the work item type of the process. + * Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. * - * @param {WorkItemTrackingProcessInterfaces.WorkItemTypeBehavior} behavior - * @param {string} processId - The ID of the process - * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {string} path - Wiki page path. + * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional). + * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - GitVersionDescriptor for the page. Defaults to the default branch (Optional). + * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional) */ - addBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) { + getPageZip(project, wikiIdentifier, path, recursionLevel, versionDescriptor, includeContent) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefNameForBehaviors: witRefNameForBehaviors + project: project, + wikiIdentifier: wikiIdentifier + }; + let queryValues = { + path: path, + recursionLevel: recursionLevel, + versionDescriptor: versionDescriptor, + includeContent: includeContent, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.create(url, behavior, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -37697,28 +39657,32 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns a behavior for the work item type of the process. + * Gets metadata or content of the wiki page for the provided page id. Content negotiation is done based on the `Accept` header sent in the request. * - * @param {string} processId - The ID of the process - * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior - * @param {string} behaviorRefName - The reference name of the behavior + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name.. + * @param {number} id - Wiki page ID. + * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional). + * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional) */ - getBehaviorForWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) { + getPageByIdText(project, wikiIdentifier, id, recursionLevel, includeContent) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefNameForBehaviors: witRefNameForBehaviors, - behaviorRefName: behaviorRefName + project: project, + wikiIdentifier: wikiIdentifier, + id: id + }; + let queryValues = { + recursionLevel: recursionLevel, + includeContent: includeContent, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "ceddcf75-1068-452d-8b13-2d4d76e1f970", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("text/plain", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -37727,26 +39691,32 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Returns a list of all behaviors for the work item type of the process. + * Gets metadata or content of the wiki page for the provided page id. Content negotiation is done based on the `Accept` header sent in the request. * - * @param {string} processId - The ID of the process - * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name.. + * @param {number} id - Wiki page ID. + * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional). + * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional) */ - getBehaviorsForWorkItemType(processId, witRefNameForBehaviors) { + getPageByIdZip(project, wikiIdentifier, id, recursionLevel, includeContent) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefNameForBehaviors: witRefNameForBehaviors + project: project, + wikiIdentifier: wikiIdentifier, + id: id + }; + let queryValues = { + recursionLevel: recursionLevel, + includeContent: includeContent, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "ceddcf75-1068-452d-8b13-2d4d76e1f970", routeValues, queryValues); let url = verData.requestUrl; - let options = this.createRequestOptions('application/json', verData.apiVersion); - let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); - resolve(ret); + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); } catch (err) { reject(err); @@ -37755,27 +39725,30 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Removes a behavior for the work item type of the process. + * Returns pageable list of Wiki Pages * - * @param {string} processId - The ID of the process - * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior - * @param {string} behaviorRefName - The reference name of the behavior + * @param {WikiInterfaces.WikiPagesBatchRequest} pagesBatchRequest - Wiki batch page request. + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - GitVersionDescriptor for the page. (Optional in case of ProjectWiki). */ - removeBehaviorFromWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) { + getPagesBatch(pagesBatchRequest, project, wikiIdentifier, versionDescriptor) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefNameForBehaviors: witRefNameForBehaviors, - behaviorRefName: behaviorRefName + project: project, + wikiIdentifier: wikiIdentifier + }; + let queryValues = { + versionDescriptor: versionDescriptor, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "71323c46-2592-4398-8771-ced73dd87207", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, pagesBatchRequest, options); + let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiPageDetail, true); resolve(ret); } catch (err) { @@ -37785,26 +39758,31 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { }); } /** - * Updates a behavior for the work item type of the process. + * Returns page detail corresponding to Page ID. * - * @param {WorkItemTrackingProcessInterfaces.WorkItemTypeBehavior} behavior - * @param {string} processId - The ID of the process - * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {number} pageId - Wiki page ID. + * @param {number} pageViewsForDays - last N days from the current day for which page views is to be returned. It's inclusive of current day. */ - updateBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) { + getPageData(project, wikiIdentifier, pageId, pageViewsForDays) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefNameForBehaviors: witRefNameForBehaviors + project: project, + wikiIdentifier: wikiIdentifier, + pageId: pageId + }; + let queryValues = { + pageViewsForDays: pageViewsForDays, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "81c4e0fe-7663-4d62-ad46-6ab78459f274", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, behavior, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiPageDetail, false); resolve(ret); } catch (err) { @@ -37813,61 +39791,40 @@ class WorkItemTrackingProcessApi extends basem.ClientApiBase { })); }); } -} -WorkItemTrackingProcessApi.RESOURCE_AREA_ID = "5264459e-e5e0-4bd8-b118-0985e68a4ec5"; -exports.WorkItemTrackingProcessApi = WorkItemTrackingProcessApi; - - -/***/ }), - -/***/ 3333: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const basem = __nccwpck_require__(273); -const WorkItemTrackingProcessDefinitionsInterfaces = __nccwpck_require__(1655); -class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { - constructor(baseUrl, handlers, options) { - super(baseUrl, handlers, 'node-WorkItemTracking-api', options); - } /** - * Creates a single behavior in the given process. + * Creates a new page view stats resource or updates an existing page view stats resource. * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.BehaviorCreateModel} behavior - * @param {string} processId - The ID of the process + * @param {string} project - Project ID or project name + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {GitInterfaces.GitVersionDescriptor} wikiVersion - Wiki version. + * @param {string} path - Wiki page path. + * @param {string} oldPath - Old page path. This is optional and required to rename path in existing page view stats. */ - createBehavior(behavior, processId) { + createOrUpdatePageViewStats(project, wikiIdentifier, wikiVersion, path, oldPath) { return __awaiter(this, void 0, void 0, function* () { + if (wikiVersion == null) { + throw new TypeError('wikiVersion can not be null or undefined'); + } + if (path == null) { + throw new TypeError('path can not be null or undefined'); + } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId + project: project, + wikiIdentifier: wikiIdentifier + }; + let queryValues = { + wikiVersion: wikiVersion, + path: path, + oldPath: oldPath, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "wiki", "1087b746-5d15-41b9-bea6-14e325e7f880", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, behavior, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, null, options); + let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiPageViewStats, false); resolve(ret); } catch (err) { @@ -37877,25 +39834,24 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Removes a behavior in the process. + * Creates the wiki resource. * - * @param {string} processId - The ID of the process - * @param {string} behaviorId - The ID of the behavior + * @param {WikiInterfaces.WikiCreateParametersV2} wikiCreateParams - Parameters for the wiki creation. + * @param {string} project - Project ID or project name */ - deleteBehavior(processId, behaviorId) { + createWiki(wikiCreateParams, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - behaviorId: behaviorId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "wiki", "288d122c-dbd4-451d-aa5f-7dbbba070728", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.create(url, wikiCreateParams, options); + let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiV2, false); resolve(ret); } catch (err) { @@ -37905,25 +39861,25 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a single behavior in the process. + * Deletes the wiki corresponding to the wiki ID or wiki name provided. * - * @param {string} processId - The ID of the process - * @param {string} behaviorId - The ID of the behavior + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {string} project - Project ID or project name */ - getBehavior(processId, behaviorId) { + deleteWiki(wikiIdentifier, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - behaviorId: behaviorId + project: project, + wikiIdentifier: wikiIdentifier }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "wiki", "288d122c-dbd4-451d-aa5f-7dbbba070728", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiV2, false); resolve(ret); } catch (err) { @@ -37933,23 +39889,23 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a list of all behaviors in the process. + * Gets all wikis in a project or collection. * - * @param {string} processId - The ID of the process + * @param {string} project - Project ID or project name */ - getBehaviors(processId) { + getAllWikis(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "wiki", "288d122c-dbd4-451d-aa5f-7dbbba070728", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiV2, true); resolve(ret); } catch (err) { @@ -37959,26 +39915,25 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Replaces a behavior in the process. + * Gets the wiki corresponding to the wiki ID or wiki name provided. * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.BehaviorReplaceModel} behaviorData - * @param {string} processId - The ID of the process - * @param {string} behaviorId - The ID of the behavior + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {string} project - Project ID or project name */ - replaceBehavior(behaviorData, processId, behaviorId) { + getWiki(wikiIdentifier, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - behaviorId: behaviorId + project: project, + wikiIdentifier: wikiIdentifier }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "wiki", "288d122c-dbd4-451d-aa5f-7dbbba070728", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, behaviorData, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiV2, false); resolve(ret); } catch (err) { @@ -37988,28 +39943,26 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Creates a control in a group + * Updates the wiki corresponding to the wiki ID or wiki name provided using the update parameters. * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.Control} control - The control - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} groupId - The ID of the group to add the control to + * @param {WikiInterfaces.WikiUpdateParameters} updateParameters - Update parameters. + * @param {string} wikiIdentifier - Wiki ID or wiki name. + * @param {string} project - Project ID or project name */ - addControlToGroup(control, processId, witRefName, groupId) { + updateWiki(updateParameters, wikiIdentifier, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - groupId: groupId + project: project, + wikiIdentifier: wikiIdentifier }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "wiki", "288d122c-dbd4-451d-aa5f-7dbbba070728", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, control, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, updateParameters, options); + let ret = this.formatResponse(res.result, WikiInterfaces.TypeInfo.WikiV2, false); resolve(ret); } catch (err) { @@ -38018,30 +39971,69 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { })); }); } +} +exports.WikiApi = WikiApi; +WikiApi.RESOURCE_AREA_ID = "bf7d82a0-8aa5-4613-94ef-6172a5ea01f3"; + + +/***/ }), + +/***/ 8186: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WorkApi = void 0; +const basem = __nccwpck_require__(273); +const WorkInterfaces = __nccwpck_require__(7480); +class WorkApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-Work-api', options); + } /** - * Updates a control on the work item form + * Creates/updates an automation rules settings * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.Control} control - The updated control - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} groupId - The ID of the group - * @param {string} controlId - The ID of the control + * @param {WorkInterfaces.TeamAutomationRulesSettingsRequestModel} ruleRequestModel - Required parameters to create/update an automation rules settings + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - editControl(control, processId, witRefName, groupId, controlId) { + updateAutomationRule(ruleRequestModel, teamContext) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - groupId: groupId, - controlId: controlId + project: project, + team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "work", "2882c15d-0cb3-43b5-8fb7-db62e09a79db", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, control, options); + res = yield this.rest.update(url, ruleRequestModel, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38052,29 +40044,30 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Removes a control from the work item form + * Gets backlog configuration for a team * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} groupId - The ID of the group - * @param {string} controlId - The ID of the control to remove + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - removeControlFromGroup(processId, witRefName, groupId, controlId) { + getBacklogConfigurations(teamContext) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - groupId: groupId, - controlId: controlId + project: project, + team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "7799f497-3cb5-4f16-ad4f-5cd06012db64", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.BacklogConfiguration, false); resolve(ret); } catch (err) { @@ -38084,33 +40077,31 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Moves a control to a new group + * Get a list of work items within a backlog level * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.Control} control - The control - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} groupId - The ID of the group to move the control to - * @param {string} controlId - The id of the control - * @param {string} removeFromGroupId - The group to remove the control from + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} backlogId */ - setControlInGroup(control, processId, witRefName, groupId, controlId, removeFromGroupId) { + getBacklogLevelWorkItems(teamContext, backlogId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - groupId: groupId, - controlId: controlId - }; - let queryValues = { - removeFromGroupId: removeFromGroupId, + project: project, + team: team, + backlogId: backlogId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "7c468d96-ab1d-4294-a360-92f07e9ccd98", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, control, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38121,24 +40112,32 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Creates a single field in the process. + * Get a backlog level * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.FieldModel} field - * @param {string} processId - The ID of the process + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} id - The id of the backlog level */ - createField(field, processId) { + getBacklog(teamContext, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId + project: project, + team: team, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "f36c66c7-911d-4163-8938-d3c5d0d7f5aa", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "a93726f9-7867-4e38-b4f2-0bfafc2f6a94", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, field, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.FieldModel, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.BacklogLevelConfiguration, false); resolve(ret); } catch (err) { @@ -38148,24 +40147,30 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Updates a given field in the process. + * List all backlog levels * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.FieldUpdate} field - * @param {string} processId - The ID of the process + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - updateField(field, processId) { + getBacklogs(teamContext) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId + project: project, + team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "f36c66c7-911d-4163-8938-d3c5d0d7f5aa", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "a93726f9-7867-4e38-b4f2-0bfafc2f6a94", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, field, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.FieldModel, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.BacklogLevelConfiguration, true); resolve(ret); } catch (err) { @@ -38175,29 +40180,37 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Adds a group to the work item form + * Gets a badge that displays the status of columns on the board. * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.Group} group - The group - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} pageId - The ID of the page to add the group to - * @param {string} sectionId - The ID of the section to add the group to + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} id - The id of the board. + * @param {WorkInterfaces.BoardBadgeColumnOptions} columnOptions - Determines what columns to show. + * @param {string[]} columns - If columnOptions is set to custom, specify the list of column names. */ - addGroup(group, processId, witRefName, pageId, sectionId) { + getBoardBadge(teamContext, id, columnOptions, columns) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId, - sectionId: sectionId + project: project, + team: team, + id: id + }; + let queryValues = { + columnOptions: columnOptions, + columns: columns && columns.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "0120b002-ab6c-4ca0-98cf-a8d7492f865c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, group, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38208,31 +40221,37 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Updates a group in the work item form + * Gets a badge that displays the status of columns on the board. * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.Group} group - The updated group - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} pageId - The ID of the page the group is in - * @param {string} sectionId - The ID of the section the group is in - * @param {string} groupId - The ID of the group + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} id - The id of the board. + * @param {WorkInterfaces.BoardBadgeColumnOptions} columnOptions - Determines what columns to show. + * @param {string[]} columns - If columnOptions is set to custom, specify the list of column names. */ - editGroup(group, processId, witRefName, pageId, sectionId, groupId) { + getBoardBadgeData(teamContext, id, columnOptions, columns) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId, - sectionId: sectionId, - groupId: groupId + project: project, + team: team, + id: id + }; + let queryValues = { + columnOptions: columnOptions, + columns: columns && columns.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "0120b002-ab6c-4ca0-98cf-a8d7492f865c", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, group, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38243,31 +40262,23 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Removes a group from the work item form + * Get available board columns in a project * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} pageId - The ID of the page the group is in - * @param {string} sectionId - The ID of the section to the group is in - * @param {string} groupId - The ID of the group + * @param {string} project - Project ID or project name */ - removeGroup(processId, witRefName, pageId, sectionId, groupId) { + getColumnSuggestedValues(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId, - sectionId: sectionId, - groupId: groupId + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "eb7ec5a3-1ba3-4fd1-b834-49a5a387e57d", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -38277,44 +40288,42 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Moves a group to a different page and section + * Returns the list of parent field filter model for the given list of workitem ids * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.Group} group - The updated group - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} pageId - The ID of the page the group is in - * @param {string} sectionId - The ID of the section the group is in - * @param {string} groupId - The ID of the group - * @param {string} removeFromPageId - ID of the page to remove the group from - * @param {string} removeFromSectionId - ID of the section to remove the group from + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} childBacklogContextCategoryRefName + * @param {number[]} workitemIds */ - setGroupInPage(group, processId, witRefName, pageId, sectionId, groupId, removeFromPageId, removeFromSectionId) { + getBoardMappingParentItems(teamContext, childBacklogContextCategoryRefName, workitemIds) { return __awaiter(this, void 0, void 0, function* () { - if (removeFromPageId == null) { - throw new TypeError('removeFromPageId can not be null or undefined'); + if (childBacklogContextCategoryRefName == null) { + throw new TypeError('childBacklogContextCategoryRefName can not be null or undefined'); } - if (removeFromSectionId == null) { - throw new TypeError('removeFromSectionId can not be null or undefined'); + if (workitemIds == null) { + throw new TypeError('workitemIds can not be null or undefined'); } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId, - sectionId: sectionId, - groupId: groupId + project: project, + team: team }; let queryValues = { - removeFromPageId: removeFromPageId, - removeFromSectionId: removeFromSectionId, + childBacklogContextCategoryRefName: childBacklogContextCategoryRefName, + workitemIds: workitemIds && workitemIds.join(","), }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "186abea3-5c35-432f-9e28-7a15b4312a0e", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, group, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -38324,39 +40333,23 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Moves a group to a different section + * Get available board rows in a project * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.Group} group - The updated group - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} pageId - The ID of the page the group is in - * @param {string} sectionId - The ID of the section the group is in - * @param {string} groupId - The ID of the group - * @param {string} removeFromSectionId - ID of the section to remove the group from + * @param {string} project - Project ID or project name */ - setGroupInSection(group, processId, witRefName, pageId, sectionId, groupId, removeFromSectionId) { + getRowSuggestedValues(project) { return __awaiter(this, void 0, void 0, function* () { - if (removeFromSectionId == null) { - throw new TypeError('removeFromSectionId can not be null or undefined'); - } return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId, - sectionId: sectionId, - groupId: groupId - }; - let queryValues = { - removeFromSectionId: removeFromSectionId, + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "bb494cc6-a0f5-4c6c-8dca-ea6912e79eb9", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, group, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -38366,25 +40359,32 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Gets the form layout + * Get board * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} id - identifier for board, either board's backlog level name (Eg:"Stories") or Id */ - getFormLayout(processId, witRefName) { + getBoard(teamContext, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + team: team, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "3eacc80a-ddca-4404-857a-6331aac99063", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "23ad19fc-3b8e-4877-8462-b3f92bc06b40", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.FormLayout, false); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.Board, false); resolve(ret); } catch (err) { @@ -38394,15 +40394,25 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns meta data of the picklist. + * Get boards * + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - getListsMetadata() { + getBoards(teamContext) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "b45cc931-98e3-44a1-b1cd-2e8e9c6dc1c6", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "23ad19fc-3b8e-4877-8462-b3f92bc06b40", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; @@ -38417,21 +40427,33 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Creates a picklist. + * Update board options * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.PickListModel} picklist + * @param {{ [key: string] : string; }} options - options to updated + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} id - identifier for board, either category plural name (Eg:"Stories") or guid */ - createList(picklist) { + setBoardOptions(options, teamContext, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let routeValues = {}; + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + id: id + }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "23ad19fc-3b8e-4877-8462-b3f92bc06b40", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, picklist, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.replace(url, options, options); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -38441,22 +40463,31 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Removes a picklist. + * Get board user settings for a board id * - * @param {string} listId - The ID of the list + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board - Board ID or Name */ - deleteList(listId) { + getBoardUserSettings(teamContext, board) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - listId: listId + project: project, + team: team, + board: board }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "b30d9f58-1891-4b0a-b168-c46408f919b0", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38467,22 +40498,32 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a picklist. + * Update board user settings for the board id * - * @param {string} listId - The ID of the list + * @param {{ [key: string] : string; }} boardUserSettings + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board */ - getList(listId) { + updateBoardUserSettings(boardUserSettings, teamContext, board) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - listId: listId + project: project, + team: team, + board: board }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "b30d9f58-1891-4b0a-b168-c46408f919b0", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.update(url, boardUserSettings, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38493,24 +40534,32 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Updates a list. + * Get a team's capacity including total capacity and days off * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.PickListModel} picklist - * @param {string} listId - The ID of the list + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId - ID of the iteration */ - updateList(picklist, listId) { + getCapacitiesWithIdentityRefAndTotals(teamContext, iterationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - listId: listId + project: project, + team: team, + iterationId: iterationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "work", "74412d15-8c1a-4352-a48d-ef1ed5587d57", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, picklist, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamCapacity, false); resolve(ret); } catch (err) { @@ -38520,26 +40569,34 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Adds a page to the work item form + * Get a team member's capacity * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.Page} page - The page - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId - ID of the iteration + * @param {string} teamMemberId - ID of the team member */ - addPage(page, processId, witRefName) { + getCapacityWithIdentityRef(teamContext, iterationId, teamMemberId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + team: team, + iterationId: iterationId, + teamMemberId: teamMemberId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "1b4ac126-59b2-4f37-b4df-0a48ba807edb", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "work", "74412d15-8c1a-4352-a48d-ef1ed5587d57", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, page, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.Page, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamMemberCapacityIdentityRef, false); resolve(ret); } catch (err) { @@ -38549,26 +40606,33 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Updates a page on the work item form + * Replace a team's capacity * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.Page} page - The page - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type + * @param {WorkInterfaces.TeamMemberCapacityIdentityRef[]} capacities - Team capacity to replace + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId - ID of the iteration */ - editPage(page, processId, witRefName) { + replaceCapacitiesWithIdentityRef(capacities, teamContext, iterationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + team: team, + iterationId: iterationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "1b4ac126-59b2-4f37-b4df-0a48ba807edb", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "work", "74412d15-8c1a-4352-a48d-ef1ed5587d57", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, page, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.Page, false); + res = yield this.rest.replace(url, capacities, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamMemberCapacityIdentityRef, true); resolve(ret); } catch (err) { @@ -38578,27 +40642,35 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Removes a page from the work item form + * Update a team member's capacity * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} pageId - The ID of the page + * @param {WorkInterfaces.CapacityPatch} patch - Updated capacity + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId - ID of the iteration + * @param {string} teamMemberId - ID of the team member */ - removePage(processId, witRefName, pageId) { + updateCapacityWithIdentityRef(patch, teamContext, iterationId, teamMemberId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - pageId: pageId + project: project, + team: team, + iterationId: iterationId, + teamMemberId: teamMemberId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "1b4ac126-59b2-4f37-b4df-0a48ba807edb", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "work", "74412d15-8c1a-4352-a48d-ef1ed5587d57", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.update(url, patch, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamMemberCapacityIdentityRef, false); resolve(ret); } catch (err) { @@ -38608,25 +40680,31 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Creates a state definition in the work item type of the process. + * Get board card Rule settings for the board id or board by name * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemStateInputModel} stateModel - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board */ - createStateDefinition(stateModel, processId, witRefName) { + getBoardCardRuleSettings(teamContext, board) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + team: team, + board: board }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "work", "b044a3d9-02ea-49c7-91a1-b730949cc896", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, stateModel, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38637,26 +40715,32 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Removes a state definition in the work item type of the process. + * Update board card Rule settings for the board id or board by name * - * @param {string} processId - ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} stateId - ID of the state + * @param {WorkInterfaces.BoardCardRuleSettings} boardCardRuleSettings + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board */ - deleteStateDefinition(processId, witRefName, stateId) { + updateBoardCardRuleSettings(boardCardRuleSettings, teamContext, board) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - stateId: stateId + project: project, + team: team, + board: board }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "work", "b044a3d9-02ea-49c7-91a1-b730949cc896", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.update(url, boardCardRuleSettings, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38667,26 +40751,30 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a state definition in the work item type of the process. + * Update taskboard card Rule settings * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} stateId - The ID of the state + * @param {WorkInterfaces.BoardCardRuleSettings} boardCardRuleSettings + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - getStateDefinition(processId, witRefName, stateId) { + updateTaskboardCardRuleSettings(boardCardRuleSettings, teamContext) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - stateId: stateId + project: project, + team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "work", "3f84a8d1-1aab-423e-a94b-6dcbdcca511f", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); + res = yield this.rest.update(url, boardCardRuleSettings, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38697,25 +40785,32 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a list of all state definitions in the work item type of the process. + * Get board card settings for the board id or board by name * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board */ - getStateDefinitions(processId, witRefName) { + getBoardCardSettings(teamContext, board) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + team: team, + board: board }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "work", "07c3b467-bc60-4f05-8e34-599ce288fafc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -38725,27 +40820,32 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Hides a state definition in the work item type of the process. + * Update board card settings for the board id or board by name * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.HideStateModel} hideStateModel - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} stateId - The ID of the state + * @param {WorkInterfaces.BoardCardSettings} boardCardSettingsToSave + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board */ - hideStateDefinition(hideStateModel, processId, witRefName, stateId) { + updateBoardCardSettings(boardCardSettingsToSave, teamContext, board) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - stateId: stateId + project: project, + team: team, + board: board }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "work", "07c3b467-bc60-4f05-8e34-599ce288fafc", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.replace(url, hideStateModel, options); + res = yield this.rest.replace(url, boardCardSettingsToSave, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38756,27 +40856,30 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Updates a given state definition in the work item type of the process. + * Update taskboard card settings * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemStateInputModel} stateModel - * @param {string} processId - ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {string} stateId - ID of the state + * @param {WorkInterfaces.BoardCardSettings} boardCardSettingsToSave + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - updateStateDefinition(stateModel, processId, witRefName, stateId) { + updateTaskboardCardSettings(boardCardSettingsToSave, teamContext) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName, - stateId: stateId + project: project, + team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "work", "0d63745f-31f3-4cf3-9056-2a064e567637", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, stateModel, options); + res = yield this.rest.replace(url, boardCardSettingsToSave, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38787,25 +40890,33 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Adds a behavior to the work item type of the process. + * Get a board chart * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeBehavior} behavior - * @param {string} processId - The ID of the process - * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either board's backlog level name (Eg:"Stories") or Id + * @param {string} name - The chart name */ - addBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) { + getBoardChart(teamContext, board, name) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefNameForBehaviors: witRefNameForBehaviors + project: project, + team: team, + board: board, + name: name }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "45fe888c-239e-49fd-958c-df1a1ab21d97", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, behavior, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38816,27 +40927,32 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a behavior for the work item type of the process. + * Get board charts * - * @param {string} processId - The ID of the process - * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior - * @param {string} behaviorRefName - The reference name of the behavior + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either board's backlog level name (Eg:"Stories") or Id */ - getBehaviorForWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) { + getBoardCharts(teamContext, board) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefNameForBehaviors: witRefNameForBehaviors, - behaviorRefName: behaviorRefName + project: project, + team: team, + board: board }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "45fe888c-239e-49fd-958c-df1a1ab21d97", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, false); + let ret = this.formatResponse(res.result, null, true); resolve(ret); } catch (err) { @@ -38846,25 +40962,35 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a list of all behaviors for the work item type of the process. + * Update a board chart * - * @param {string} processId - The ID of the process - * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + * @param {WorkInterfaces.BoardChart} chart + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board - Identifier for board, either board's backlog level name (Eg:"Stories") or Id + * @param {string} name - The chart name */ - getBehaviorsForWorkItemType(processId, witRefNameForBehaviors) { + updateBoardChart(chart, teamContext, board, name) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefNameForBehaviors: witRefNameForBehaviors + project: project, + team: team, + board: board, + name: name }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "45fe888c-239e-49fd-958c-df1a1ab21d97", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, null, true); + res = yield this.rest.update(url, chart, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -38874,27 +41000,32 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Removes a behavior for the work item type of the process. + * Get columns on a board * - * @param {string} processId - The ID of the process - * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior - * @param {string} behaviorRefName - The reference name of the behavior + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board - Name or ID of the specific board */ - removeBehaviorFromWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) { + getBoardColumns(teamContext, board) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefNameForBehaviors: witRefNameForBehaviors, - behaviorRefName: behaviorRefName + project: project, + team: team, + board: board }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "c555d7ff-84e1-47df-9923-a3fe0cd8751b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.BoardColumn, true); resolve(ret); } catch (err) { @@ -38904,26 +41035,33 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Updates default work item type for the behavior of the process. + * Update columns on a board * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeBehavior} behavior - * @param {string} processId - The ID of the process - * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + * @param {WorkInterfaces.BoardColumn[]} boardColumns - List of board columns to update + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board - Name or ID of the specific board */ - updateBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) { + updateBoardColumns(boardColumns, teamContext, board) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefNameForBehaviors: witRefNameForBehaviors + project: project, + team: team, + board: board }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "c555d7ff-84e1-47df-9923-a3fe0cd8751b", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, behavior, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.replace(url, boardColumns, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.BoardColumn, true); resolve(ret); } catch (err) { @@ -38933,24 +41071,33 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Creates a work item type in the process. + * Get Delivery View Data * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeModel} workItemType - * @param {string} processId - The ID of the process + * @param {string} project - Project ID or project name + * @param {string} id - Identifier for delivery view + * @param {number} revision - Revision of the plan for which you want data. If the current plan is a different revision you will get an ViewRevisionMismatchException exception. If you do not supply a revision you will get data for the latest revision. + * @param {Date} startDate - The start date of timeline + * @param {Date} endDate - The end date of timeline */ - createWorkItemType(workItemType, processId) { + getDeliveryTimelineData(project, id, revision, startDate, endDate) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId + project: project, + id: id + }; + let queryValues = { + revision: revision, + startDate: startDate, + endDate: endDate, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "bdd0834e-101f-49f0-a6ae-509f384a12b4", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, workItemType, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.DeliveryViewData, false); resolve(ret); } catch (err) { @@ -38960,24 +41107,24 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Removes a work itewm type in the process. + * Get an iteration's capacity for all teams in iteration * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type + * @param {string} project - Project ID or project name + * @param {string} iterationId - ID of the iteration */ - deleteWorkItemType(processId, witRefName) { + getTotalIterationCapacities(project, iterationId) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + iterationId: iterationId }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "1e385ce0-396b-4273-8171-d64562c18d37", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); + res = yield this.rest.get(url, options); let ret = this.formatResponse(res.result, null, false); resolve(ret); } @@ -38988,29 +41135,67 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a work item type of the process. + * Delete a team's iteration by iterationId * - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type - * @param {WorkItemTrackingProcessDefinitionsInterfaces.GetWorkItemTypeExpand} expand + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} id - ID of the iteration */ - getWorkItemType(processId, witRefName, expand) { + deleteTeamIteration(teamContext, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + team: team, + id: id }; - let queryValues = { - '$expand': expand, + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "c9175577-28a1-4b06-9197-8636af9f64ad", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get team's iteration by iterationId + * + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} id - ID of the iteration + */ + getTeamIteration(teamContext, id) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "c9175577-28a1-4b06-9197-8636af9f64ad", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, false); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSettingsIteration, false); resolve(ret); } catch (err) { @@ -39020,27 +41205,34 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a list of all work item types in the process. + * Get a team's iterations using timeframe filter * - * @param {string} processId - The ID of the process - * @param {WorkItemTrackingProcessDefinitionsInterfaces.GetWorkItemTypeExpand} expand + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} timeframe - A filter for which iterations are returned based on relative time. Only Current is supported currently. */ - getWorkItemTypes(processId, expand) { + getTeamIterations(teamContext, timeframe) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId + project: project, + team: team }; let queryValues = { - '$expand': expand, + '$timeframe': timeframe, }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues, queryValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "c9175577-28a1-4b06-9197-8636af9f64ad", routeValues, queryValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, true); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSettingsIteration, true); resolve(ret); } catch (err) { @@ -39050,26 +41242,31 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Updates a work item type of the process. + * Add an iteration to the team * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeUpdateModel} workItemTypeUpdate - * @param {string} processId - The ID of the process - * @param {string} witRefName - The reference name of the work item type + * @param {WorkInterfaces.TeamSettingsIteration} iteration - Iteration to add + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - updateWorkItemType(workItemTypeUpdate, processId, witRefName) { + postTeamIteration(iteration, teamContext) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } let routeValues = { - processId: processId, - witRefName: witRefName + project: project, + team: team }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "c9175577-28a1-4b06-9197-8636af9f64ad", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, workItemTypeUpdate, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, false); + res = yield this.rest.create(url, iteration, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSettingsIteration, false); resolve(ret); } catch (err) { @@ -39079,26 +41276,24 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Adds a field to the work item type in the process. + * Add a new plan for the team * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeFieldModel2} field - * @param {string} processId - The ID of the process - * @param {string} witRefNameForFields - Work item type reference name for the field + * @param {WorkInterfaces.CreatePlan} postedPlan - Plan definition + * @param {string} project - Project ID or project name */ - addFieldToWorkItemType(field, processId, witRefNameForFields) { + createPlan(postedPlan, project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefNameForFields: witRefNameForFields + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "0b42cb47-cd73-4810-ac90-19c9ba147453", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.create(url, field, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, false); + res = yield this.rest.create(url, postedPlan, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.Plan, false); resolve(ret); } catch (err) { @@ -39108,27 +41303,25 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a single field in the work item type of the process. + * Delete the specified plan * - * @param {string} processId - The ID of the process - * @param {string} witRefNameForFields - Work item type reference name for fields - * @param {string} fieldRefName - The reference name of the field + * @param {string} project - Project ID or project name + * @param {string} id - Identifier of the plan */ - getWorkItemTypeField(processId, witRefNameForFields, fieldRefName) { + deletePlan(project, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefNameForFields: witRefNameForFields, - fieldRefName: fieldRefName + project: project, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "0b42cb47-cd73-4810-ac90-19c9ba147453", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, false); + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); resolve(ret); } catch (err) { @@ -39138,25 +41331,25 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Returns a list of all fields in the work item type of the process. + * Get the information for the specified plan * - * @param {string} processId - The ID of the process - * @param {string} witRefNameForFields - Work item type reference name for fields + * @param {string} project - Project ID or project name + * @param {string} id - Identifier of the plan */ - getWorkItemTypeFields(processId, witRefNameForFields) { + getPlan(project, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefNameForFields: witRefNameForFields + project: project, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "0b42cb47-cd73-4810-ac90-19c9ba147453", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; res = yield this.rest.get(url, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, true); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.Plan, false); resolve(ret); } catch (err) { @@ -39166,27 +41359,23 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Removes a field in the work item type of the process. + * Get the information for all the plans configured for the given team * - * @param {string} processId - The ID of the process - * @param {string} witRefNameForFields - Work item type reference name for fields - * @param {string} fieldRefName - The reference name of the field + * @param {string} project - Project ID or project name */ - removeFieldFromWorkItemType(processId, witRefNameForFields, fieldRefName) { + getPlans(project) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefNameForFields: witRefNameForFields, - fieldRefName: fieldRefName + project: project }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "0b42cb47-cd73-4810-ac90-19c9ba147453", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.del(url, options); - let ret = this.formatResponse(res.result, null, false); + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.Plan, true); resolve(ret); } catch (err) { @@ -39196,26 +41385,26 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { }); } /** - * Updates a single field in the scope of the given process and work item type. + * Update the information for the specified plan * - * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeFieldModel2} field - The model with which to update the field - * @param {string} processId - The ID of the process - * @param {string} witRefNameForFields - Work item type reference name for fields + * @param {WorkInterfaces.UpdatePlan} updatedPlan - Plan definition to be updated + * @param {string} project - Project ID or project name + * @param {string} id - Identifier of the plan */ - updateWorkItemTypeField(field, processId, witRefNameForFields) { + updatePlan(updatedPlan, project, id) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let routeValues = { - processId: processId, - witRefNameForFields: witRefNameForFields + project: project, + id: id }; try { - let verData = yield this.vsoClient.getVersioningData("6.1-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues); + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "0b42cb47-cd73-4810-ac90-19c9ba147453", routeValues); let url = verData.requestUrl; let options = this.createRequestOptions('application/json', verData.apiVersion); let res; - res = yield this.rest.update(url, field, options); - let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, false); + res = yield this.rest.replace(url, updatedPlan, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.Plan, false); resolve(ret); } catch (err) { @@ -39224,725 +41413,8170 @@ class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { })); }); } -} -WorkItemTrackingProcessDefinitionsApi.RESOURCE_AREA_ID = "5264459e-e5e0-4bd8-b118-0985e68a4ec5"; -exports.WorkItemTrackingProcessDefinitionsApi = WorkItemTrackingProcessDefinitionsApi; - - -/***/ }), - -/***/ 6456: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const resthandlers = __nccwpck_require__(4442); -class BasicCredentialHandler extends resthandlers.BasicCredentialHandler { - constructor(username, password, allowCrossOriginAuthentication = true) { - super(username, password, allowCrossOriginAuthentication); - } -} -exports.BasicCredentialHandler = BasicCredentialHandler; - - -/***/ }), - -/***/ 1141: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const resthandlers = __nccwpck_require__(4442); -class BearerCredentialHandler extends resthandlers.BearerCredentialHandler { - constructor(token, allowCrossOriginAuthentication = true) { - super(token, allowCrossOriginAuthentication); - } -} -exports.BearerCredentialHandler = BearerCredentialHandler; - - -/***/ }), - -/***/ 3450: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const resthandlers = __nccwpck_require__(4442); -class NtlmCredentialHandler extends resthandlers.NtlmCredentialHandler { - constructor(username, password, workstation, domain) { - super(username, password, workstation, domain); - } -} -exports.NtlmCredentialHandler = NtlmCredentialHandler; - - -/***/ }), - -/***/ 4551: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const resthandlers = __nccwpck_require__(4442); -class PersonalAccessTokenCredentialHandler extends resthandlers.PersonalAccessTokenCredentialHandler { - constructor(token, allowCrossOriginAuthentication = true) { - super(token, allowCrossOriginAuthentication); - } -} -exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - - -/***/ }), - -/***/ 2167: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -/* - * --------------------------------------------------------- - * Copyright(C) Microsoft Corporation. All rights reserved. - * --------------------------------------------------------- - * - * --------------------------------------------------------- - * Generated file, DO NOT EDIT - * --------------------------------------------------------- - */ - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const TFS_TestManagement_Contracts = __nccwpck_require__(3047); -const TfsCoreInterfaces = __nccwpck_require__(3931); -var AgentStatus; -(function (AgentStatus) { - /** - * Indicates that the build agent cannot be contacted. - */ - AgentStatus[AgentStatus["Unavailable"] = 0] = "Unavailable"; - /** - * Indicates that the build agent is currently available. - */ - AgentStatus[AgentStatus["Available"] = 1] = "Available"; /** - * Indicates that the build agent has taken itself offline. + * Retrieves the set of known queries + * + * @param {string} project - Project ID or project name */ - AgentStatus[AgentStatus["Offline"] = 2] = "Offline"; -})(AgentStatus = exports.AgentStatus || (exports.AgentStatus = {})); -var AuditAction; -(function (AuditAction) { - AuditAction[AuditAction["Add"] = 1] = "Add"; - AuditAction[AuditAction["Update"] = 2] = "Update"; - AuditAction[AuditAction["Delete"] = 3] = "Delete"; -})(AuditAction = exports.AuditAction || (exports.AuditAction = {})); -/** - * Represents the desired scope of authorization for a build. - */ -var BuildAuthorizationScope; -(function (BuildAuthorizationScope) { + getPredefinedQueries(project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "9cbba37c-6cc6-4f70-b903-709be86acbf0", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The identity used should have build service account permissions scoped to the project collection. This is useful when resources for a single build are spread across multiple projects. + * Retrieves the specified predefined query including the query results + * + * @param {string} project - Project ID or project name + * @param {string} id - Id of the query to run + * @param {number} top - The maximum number of items to return + * @param {boolean} includeCompleted - Whether or not to retrieve the 'completed' work items (work items in the 'completed' meta state) */ - BuildAuthorizationScope[BuildAuthorizationScope["ProjectCollection"] = 1] = "ProjectCollection"; + getPredefinedQueryResults(project, id, top, includeCompleted) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + let queryValues = { + '$top': top, + includeCompleted: includeCompleted, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "9cbba37c-6cc6-4f70-b903-709be86acbf0", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The identity used should have build service account permissions scoped to the project in which the build definition resides. This is useful for isolation of build jobs to a particular team project to avoid any unintentional escalation of privilege attacks during a build. + * Get process configuration + * + * @param {string} project - Project ID or project name */ - BuildAuthorizationScope[BuildAuthorizationScope["Project"] = 2] = "Project"; -})(BuildAuthorizationScope = exports.BuildAuthorizationScope || (exports.BuildAuthorizationScope = {})); -var BuildOptionInputType; -(function (BuildOptionInputType) { - BuildOptionInputType[BuildOptionInputType["String"] = 0] = "String"; - BuildOptionInputType[BuildOptionInputType["Boolean"] = 1] = "Boolean"; - BuildOptionInputType[BuildOptionInputType["StringList"] = 2] = "StringList"; - BuildOptionInputType[BuildOptionInputType["Radio"] = 3] = "Radio"; - BuildOptionInputType[BuildOptionInputType["PickList"] = 4] = "PickList"; - BuildOptionInputType[BuildOptionInputType["MultiLine"] = 5] = "MultiLine"; - BuildOptionInputType[BuildOptionInputType["BranchFilter"] = 6] = "BranchFilter"; -})(BuildOptionInputType = exports.BuildOptionInputType || (exports.BuildOptionInputType = {})); -var BuildPhaseStatus; -(function (BuildPhaseStatus) { + getProcessConfiguration(project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "f901ba42-86d2-4b0c-89c1-3f86d06daa84", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The state is not known. + * Get rows on a board + * + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board - Name or ID of the specific board */ - BuildPhaseStatus[BuildPhaseStatus["Unknown"] = 0] = "Unknown"; + getBoardRows(teamContext, board) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + board: board + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "0863355d-aefd-4d63-8669-984c9b7b0e78", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build phase completed unsuccessfully. + * Update rows on a board + * + * @param {WorkInterfaces.BoardRow[]} boardRows - List of board rows to update + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} board - Name or ID of the specific board */ - BuildPhaseStatus[BuildPhaseStatus["Failed"] = 1] = "Failed"; - /** - * The build phase completed successfully. - */ - BuildPhaseStatus[BuildPhaseStatus["Succeeded"] = 2] = "Succeeded"; -})(BuildPhaseStatus = exports.BuildPhaseStatus || (exports.BuildPhaseStatus = {})); -/** - * Specifies the desired ordering of builds. - */ -var BuildQueryOrder; -(function (BuildQueryOrder) { + updateBoardRows(boardRows, teamContext, board) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + board: board + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "0863355d-aefd-4d63-8669-984c9b7b0e78", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, boardRows, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by finish time ascending. + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - BuildQueryOrder[BuildQueryOrder["FinishTimeAscending"] = 2] = "FinishTimeAscending"; + getColumns(teamContext) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "c6815dbe-8e7e-4ffe-9a79-e83ee712aa92", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by finish time descending. + * @param {WorkInterfaces.UpdateTaskboardColumn[]} updateColumns + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - BuildQueryOrder[BuildQueryOrder["FinishTimeDescending"] = 3] = "FinishTimeDescending"; + updateColumns(updateColumns, teamContext) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "c6815dbe-8e7e-4ffe-9a79-e83ee712aa92", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, updateColumns, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by queue time descending. + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId */ - BuildQueryOrder[BuildQueryOrder["QueueTimeDescending"] = 4] = "QueueTimeDescending"; + getWorkItemColumns(teamContext, iterationId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + iterationId: iterationId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "1be23c36-8872-4abc-b57d-402cd6c669d9", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by queue time ascending. + * @param {WorkInterfaces.UpdateTaskboardWorkItemColumn} updateColumn + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId + * @param {number} workItemId */ - BuildQueryOrder[BuildQueryOrder["QueueTimeAscending"] = 5] = "QueueTimeAscending"; + updateWorkItemColumn(updateColumn, teamContext, iterationId, workItemId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + iterationId: iterationId, + workItemId: workItemId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "1be23c36-8872-4abc-b57d-402cd6c669d9", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, updateColumn, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by start time descending. + * Get team's days off for an iteration + * + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId - ID of the iteration */ - BuildQueryOrder[BuildQueryOrder["StartTimeDescending"] = 6] = "StartTimeDescending"; + getTeamDaysOff(teamContext, iterationId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + iterationId: iterationId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "2d4faa2e-9150-4cbf-a47a-932b1b4a0773", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSettingsDaysOff, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by start time ascending. + * Set a team's days off for an iteration + * + * @param {WorkInterfaces.TeamSettingsDaysOffPatch} daysOffPatch - Team's days off patch containing a list of start and end dates + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId - ID of the iteration */ - BuildQueryOrder[BuildQueryOrder["StartTimeAscending"] = 7] = "StartTimeAscending"; -})(BuildQueryOrder = exports.BuildQueryOrder || (exports.BuildQueryOrder = {})); -var BuildReason; -(function (BuildReason) { + updateTeamDaysOff(daysOffPatch, teamContext, iterationId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + iterationId: iterationId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "2d4faa2e-9150-4cbf-a47a-932b1b4a0773", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, daysOffPatch, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSettingsDaysOff, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * No reason. This value should not be used. + * Get a collection of team field values + * + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - BuildReason[BuildReason["None"] = 0] = "None"; + getTeamFieldValues(teamContext) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "07ced576-58ed-49e6-9c1e-5cb53ab8bf2a", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was started manually. + * Update team field values + * + * @param {WorkInterfaces.TeamFieldValuesPatch} patch + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - BuildReason[BuildReason["Manual"] = 1] = "Manual"; + updateTeamFieldValues(patch, teamContext) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "07ced576-58ed-49e6-9c1e-5cb53ab8bf2a", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, patch, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was started for the trigger TriggerType.ContinuousIntegration. + * Get a team's settings + * + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - BuildReason[BuildReason["IndividualCI"] = 2] = "IndividualCI"; + getTeamSettings(teamContext) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "c3c1012b-bea7-49d7-b45e-1664e566f84c", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSetting, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was started for the trigger TriggerType.BatchedContinuousIntegration. + * Update a team's settings + * + * @param {WorkInterfaces.TeamSettingsPatch} teamSettingsPatch - TeamSettings changes + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - BuildReason[BuildReason["BatchedCI"] = 4] = "BatchedCI"; + updateTeamSettings(teamSettingsPatch, teamContext) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "c3c1012b-bea7-49d7-b45e-1664e566f84c", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, teamSettingsPatch, options); + let ret = this.formatResponse(res.result, WorkInterfaces.TypeInfo.TeamSetting, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was started for the trigger TriggerType.Schedule. + * Get work items for iteration + * + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId - ID of the iteration */ - BuildReason[BuildReason["Schedule"] = 8] = "Schedule"; + getIterationWorkItems(teamContext, iterationId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + iterationId: iterationId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "5b3ef1a6-d3ab-44cd-bafd-c7f45db850fa", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was started for the trigger TriggerType.ScheduleForced. + * Reorder Product Backlog/Boards Work Items + * + * @param {WorkInterfaces.ReorderOperation} operation + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - BuildReason[BuildReason["ScheduleForced"] = 16] = "ScheduleForced"; + reorderBacklogWorkItems(operation, teamContext) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "1c22b714-e7e4-41b9-85e0-56ee13ef55ed", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, operation, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was created by a user. + * Reorder Sprint Backlog/Taskboard Work Items + * + * @param {WorkInterfaces.ReorderOperation} operation + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} iterationId - The id of the iteration */ - BuildReason[BuildReason["UserCreated"] = 32] = "UserCreated"; + reorderIterationWorkItems(operation, teamContext, iterationId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + iterationId: iterationId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "work", "47755db2-d7eb-405a-8c25-675401525fc9", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, operation, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } +} +exports.WorkApi = WorkApi; +WorkApi.RESOURCE_AREA_ID = "1d4f49f9-02b9-4e26-b826-2cdb6195f2a9"; + + +/***/ }), + +/***/ 8409: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WorkItemTrackingApi = void 0; +const basem = __nccwpck_require__(273); +const WorkItemTrackingInterfaces = __nccwpck_require__(6938); +class WorkItemTrackingApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-WorkItemTracking-api', options); + } /** - * The build was started manually for private validation. + * INTERNAL ONLY: USED BY ACCOUNT MY WORK PAGE. This returns Doing, Done, Follows and activity work items details. + * + * @param {WorkItemTrackingInterfaces.QueryOption} queryOption */ - BuildReason[BuildReason["ValidateShelveset"] = 64] = "ValidateShelveset"; - /** - * The build was started for the trigger ContinuousIntegrationType.Gated. - */ - BuildReason[BuildReason["CheckInShelveset"] = 128] = "CheckInShelveset"; + getAccountMyWorkData(queryOption) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + '$queryOption': queryOption, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "def3d688-ddf5-4096-9024-69beea15cdbd", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.AccountMyWorkResult, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was started by a pull request. Added in resource version 3. + * Gets recent work item activities + * */ - BuildReason[BuildReason["PullRequest"] = 256] = "PullRequest"; + getRecentActivityData() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "1bc988f4-c15f-4072-ad35-497c87e3a909", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.AccountRecentActivityWorkItemModel2, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was started when another build completed. + * INTERNAL ONLY: USED BY ACCOUNT MY WORK PAGE. + * */ - BuildReason[BuildReason["BuildCompletion"] = 512] = "BuildCompletion"; + getRecentMentions() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "d60eeb6e-e18c-4478-9e94-a0094e28f41c", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.AccountRecentMentionWorkItemModel, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was started when resources in pipeline triggered it + * Get the list of work item tracking outbound artifact link types. + * */ - BuildReason[BuildReason["ResourceTrigger"] = 1024] = "ResourceTrigger"; + getWorkArtifactLinkTypes() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "1a31de40-e318-41cd-a6c6-881077df52e3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was triggered for retention policy purposes. + * Queries work items linked to a given list of artifact URI. + * + * @param {WorkItemTrackingInterfaces.ArtifactUriQuery} artifactUriQuery - Defines a list of artifact URI for querying work items. + * @param {string} project - Project ID or project name */ - BuildReason[BuildReason["Triggered"] = 1967] = "Triggered"; + queryWorkItemsForArtifactUris(artifactUriQuery, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "a9a9aa7a-8c09-44d3-ad1b-46e855c1e3d3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, artifactUriQuery, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * All reasons. + * Uploads an attachment. + * + * @param {NodeJS.ReadableStream} contentStream - Content to upload + * @param {string} fileName - The name of the file + * @param {string} uploadType - Attachment upload type: Simple or Chunked + * @param {string} project - Project ID or project name + * @param {string} areaPath - Target project Area Path */ - BuildReason[BuildReason["All"] = 2031] = "All"; -})(BuildReason = exports.BuildReason || (exports.BuildReason = {})); -/** - * This is not a Flags enum because we don't want to set multiple statuses on a build. However, when adding values, please stick to powers of 2 as if it were a Flags enum This will ensure that things that key off multiple result types (like labelling sources) continue to work - */ -var BuildResult; -(function (BuildResult) { + createAttachment(customHeaders, contentStream, fileName, uploadType, project, areaPath) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + fileName: fileName, + uploadType: uploadType, + areaPath: areaPath, + }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "application/octet-stream"; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "e07b5fa4-1499-494d-a496-64b860fd64ff", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; + let res; + res = yield this.rest.uploadStream("POST", url, contentStream, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * No result + * Downloads an attachment. + * + * @param {string} id - Attachment ID + * @param {string} fileName - Name of the file + * @param {string} project - Project ID or project name + * @param {boolean} download - If set to true always download attachment */ - BuildResult[BuildResult["None"] = 0] = "None"; + getAttachmentContent(id, fileName, project, download) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + let queryValues = { + fileName: fileName, + download: download, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "e07b5fa4-1499-494d-a496-64b860fd64ff", routeValues, queryValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/octet-stream", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build completed successfully. + * Downloads an attachment. + * + * @param {string} id - Attachment ID + * @param {string} fileName - Name of the file + * @param {string} project - Project ID or project name + * @param {boolean} download - If set to true always download attachment */ - BuildResult[BuildResult["Succeeded"] = 2] = "Succeeded"; + getAttachmentZip(id, fileName, project, download) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + let queryValues = { + fileName: fileName, + download: download, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "e07b5fa4-1499-494d-a496-64b860fd64ff", routeValues, queryValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("application/zip", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build completed compilation successfully but had other errors. + * Gets root classification nodes or list of classification nodes for a given list of nodes ids, for a given project. In case ids parameter is supplied you will get list of classification nodes for those ids. Otherwise you will get root classification nodes for this project. + * + * @param {string} project - Project ID or project name + * @param {number[]} ids - Comma separated integer classification nodes ids. It's not required, if you want root nodes. + * @param {number} depth - Depth of children to fetch. + * @param {WorkItemTrackingInterfaces.ClassificationNodesErrorPolicy} errorPolicy - Flag to handle errors in getting some nodes. Possible options are Fail and Omit. */ - BuildResult[BuildResult["PartiallySucceeded"] = 4] = "PartiallySucceeded"; + getClassificationNodes(project, ids, depth, errorPolicy) { + return __awaiter(this, void 0, void 0, function* () { + if (ids == null) { + throw new TypeError('ids can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + ids: ids && ids.join(","), + '$depth': depth, + errorPolicy: errorPolicy, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a70579d1-f53a-48ee-a5be-7be8659023b9", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build completed unsuccessfully. + * Gets root classification nodes under the project. + * + * @param {string} project - Project ID or project name + * @param {number} depth - Depth of children to fetch. */ - BuildResult[BuildResult["Failed"] = 8] = "Failed"; + getRootNodes(project, depth) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + '$depth': depth, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a70579d1-f53a-48ee-a5be-7be8659023b9", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build was canceled before starting. + * Create new or update an existing classification node. + * + * @param {WorkItemTrackingInterfaces.WorkItemClassificationNode} postedNode - Node to create or update. + * @param {string} project - Project ID or project name + * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - Structure group of the classification node, area or iteration. + * @param {string} path - Path of the classification node. */ - BuildResult[BuildResult["Canceled"] = 32] = "Canceled"; -})(BuildResult = exports.BuildResult || (exports.BuildResult = {})); -var BuildStatus; -(function (BuildStatus) { + createOrUpdateClassificationNode(postedNode, project, structureGroup, path) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + structureGroup: structureGroup, + path: path + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, postedNode, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * No status. + * Delete an existing classification node. + * + * @param {string} project - Project ID or project name + * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - Structure group of the classification node, area or iteration. + * @param {string} path - Path of the classification node. + * @param {number} reclassifyId - Id of the target classification node for reclassification. */ - BuildStatus[BuildStatus["None"] = 0] = "None"; + deleteClassificationNode(project, structureGroup, path, reclassifyId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + structureGroup: structureGroup, + path: path + }; + let queryValues = { + '$reclassifyId': reclassifyId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build is currently in progress. + * Gets the classification node for a given node path. + * + * @param {string} project - Project ID or project name + * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - Structure group of the classification node, area or iteration. + * @param {string} path - Path of the classification node. + * @param {number} depth - Depth of children to fetch. */ - BuildStatus[BuildStatus["InProgress"] = 1] = "InProgress"; + getClassificationNode(project, structureGroup, path, depth) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + structureGroup: structureGroup, + path: path + }; + let queryValues = { + '$depth': depth, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build has completed. + * Update an existing classification node. + * + * @param {WorkItemTrackingInterfaces.WorkItemClassificationNode} postedNode - Node to create or update. + * @param {string} project - Project ID or project name + * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - Structure group of the classification node, area or iteration. + * @param {string} path - Path of the classification node. */ - BuildStatus[BuildStatus["Completed"] = 2] = "Completed"; + updateClassificationNode(postedNode, project, structureGroup, path) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + structureGroup: structureGroup, + path: path + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, postedNode, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build is cancelling + * Get users who reacted on the comment. + * + * @param {string} project - Project ID or project name + * @param {number} workItemId - WorkItem ID. + * @param {number} commentId - Comment ID. + * @param {WorkItemTrackingInterfaces.CommentReactionType} reactionType - Type of the reaction. + * @param {number} top + * @param {number} skip */ - BuildStatus[BuildStatus["Cancelling"] = 4] = "Cancelling"; + getEngagedUsers(project, workItemId, commentId, reactionType, top, skip) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId, + commentId: commentId, + reactionType: reactionType + }; + let queryValues = { + '$top': top, + '$skip': skip, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "e33ca5e0-2349-4285-af3d-d72d86781c35", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build is inactive in the queue. + * Add a comment on a work item. + * + * @param {WorkItemTrackingInterfaces.CommentCreate} request - Comment create request. + * @param {string} project - Project ID or project name + * @param {number} workItemId - Id of a work item. */ - BuildStatus[BuildStatus["Postponed"] = 8] = "Postponed"; + addComment(request, project, workItemId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, request, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.Comment, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build has not yet started. + * Delete a comment on a work item. + * + * @param {string} project - Project ID or project name + * @param {number} workItemId - Id of a work item. + * @param {number} commentId */ - BuildStatus[BuildStatus["NotStarted"] = 32] = "NotStarted"; + deleteComment(project, workItemId, commentId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId, + commentId: commentId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * All status. - */ - BuildStatus[BuildStatus["All"] = 47] = "All"; -})(BuildStatus = exports.BuildStatus || (exports.BuildStatus = {})); -var ControllerStatus; -(function (ControllerStatus) { - /** - * Indicates that the build controller cannot be contacted. + * Returns a work item comment. + * + * @param {string} project - Project ID or project name + * @param {number} workItemId - Id of a work item to get the comment. + * @param {number} commentId - Id of the comment to return. + * @param {boolean} includeDeleted - Specify if the deleted comment should be retrieved. + * @param {WorkItemTrackingInterfaces.CommentExpandOptions} expand - Specifies the additional data retrieval options for work item comments. */ - ControllerStatus[ControllerStatus["Unavailable"] = 0] = "Unavailable"; + getComment(project, workItemId, commentId, includeDeleted, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId, + commentId: commentId + }; + let queryValues = { + includeDeleted: includeDeleted, + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.Comment, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Indicates that the build controller is currently available. + * Returns a list of work item comments, pageable. + * + * @param {string} project - Project ID or project name + * @param {number} workItemId - Id of a work item to get comments for. + * @param {number} top - Max number of comments to return. + * @param {string} continuationToken - Used to query for the next page of comments. + * @param {boolean} includeDeleted - Specify if the deleted comments should be retrieved. + * @param {WorkItemTrackingInterfaces.CommentExpandOptions} expand - Specifies the additional data retrieval options for work item comments. + * @param {WorkItemTrackingInterfaces.CommentSortOrder} order - Order in which the comments should be returned. */ - ControllerStatus[ControllerStatus["Available"] = 1] = "Available"; + getComments(project, workItemId, top, continuationToken, includeDeleted, expand, order) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId + }; + let queryValues = { + '$top': top, + continuationToken: continuationToken, + includeDeleted: includeDeleted, + '$expand': expand, + order: order, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentList, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Indicates that the build controller has taken itself offline. + * Returns a list of work item comments by ids. + * + * @param {string} project - Project ID or project name + * @param {number} workItemId - Id of a work item to get comments for. + * @param {number[]} ids - Comma-separated list of comment ids to return. + * @param {boolean} includeDeleted - Specify if the deleted comments should be retrieved. + * @param {WorkItemTrackingInterfaces.CommentExpandOptions} expand - Specifies the additional data retrieval options for work item comments. */ - ControllerStatus[ControllerStatus["Offline"] = 2] = "Offline"; -})(ControllerStatus = exports.ControllerStatus || (exports.ControllerStatus = {})); -var DefinitionQuality; -(function (DefinitionQuality) { - DefinitionQuality[DefinitionQuality["Definition"] = 1] = "Definition"; - DefinitionQuality[DefinitionQuality["Draft"] = 2] = "Draft"; -})(DefinitionQuality = exports.DefinitionQuality || (exports.DefinitionQuality = {})); -/** - * Specifies the desired ordering of definitions. - */ -var DefinitionQueryOrder; -(function (DefinitionQueryOrder) { + getCommentsBatch(project, workItemId, ids, includeDeleted, expand) { + return __awaiter(this, void 0, void 0, function* () { + if (ids == null) { + throw new TypeError('ids can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId + }; + let queryValues = { + ids: ids && ids.join(","), + includeDeleted: includeDeleted, + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentList, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * No order + * Update a comment on a work item. + * + * @param {WorkItemTrackingInterfaces.CommentUpdate} request - Comment update request. + * @param {string} project - Project ID or project name + * @param {number} workItemId - Id of a work item. + * @param {number} commentId */ - DefinitionQueryOrder[DefinitionQueryOrder["None"] = 0] = "None"; + updateComment(request, project, workItemId, commentId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId, + commentId: commentId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, request, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.Comment, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by created on/last modified time ascending. + * Adds a new reaction to a comment. + * + * @param {string} project - Project ID or project name + * @param {number} workItemId - WorkItem ID + * @param {number} commentId - Comment ID + * @param {WorkItemTrackingInterfaces.CommentReactionType} reactionType - Type of the reaction */ - DefinitionQueryOrder[DefinitionQueryOrder["LastModifiedAscending"] = 1] = "LastModifiedAscending"; + createCommentReaction(project, workItemId, commentId, reactionType) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId, + commentId: commentId, + reactionType: reactionType + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "f6cb3f27-1028-4851-af96-887e570dc21f", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, null, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentReaction, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by created on/last modified time descending. + * Deletes an existing reaction on a comment. + * + * @param {string} project - Project ID or project name + * @param {number} workItemId - WorkItem ID + * @param {number} commentId - Comment ID + * @param {WorkItemTrackingInterfaces.CommentReactionType} reactionType - Type of the reaction */ - DefinitionQueryOrder[DefinitionQueryOrder["LastModifiedDescending"] = 2] = "LastModifiedDescending"; + deleteCommentReaction(project, workItemId, commentId, reactionType) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId, + commentId: commentId, + reactionType: reactionType + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "f6cb3f27-1028-4851-af96-887e570dc21f", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentReaction, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by definition name ascending. + * Gets reactions of a comment. + * + * @param {string} project - Project ID or project name + * @param {number} workItemId - WorkItem ID + * @param {number} commentId - Comment ID */ - DefinitionQueryOrder[DefinitionQueryOrder["DefinitionNameAscending"] = 3] = "DefinitionNameAscending"; + getCommentReactions(project, workItemId, commentId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId, + commentId: commentId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "f6cb3f27-1028-4851-af96-887e570dc21f", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentReaction, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by definition name descending. + * @param {string} project - Project ID or project name + * @param {number} workItemId + * @param {number} commentId + * @param {number} version */ - DefinitionQueryOrder[DefinitionQueryOrder["DefinitionNameDescending"] = 4] = "DefinitionNameDescending"; -})(DefinitionQueryOrder = exports.DefinitionQueryOrder || (exports.DefinitionQueryOrder = {})); -var DefinitionQueueStatus; -(function (DefinitionQueueStatus) { + getCommentVersion(project, workItemId, commentId, version) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId, + commentId: commentId, + version: version + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "49e03b34-3be0-42e3-8a5d-e8dfb88ac954", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentVersion, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * When enabled the definition queue allows builds to be queued by users, the system will queue scheduled, gated and continuous integration builds, and the queued builds will be started by the system. + * @param {string} project - Project ID or project name + * @param {number} workItemId + * @param {number} commentId */ - DefinitionQueueStatus[DefinitionQueueStatus["Enabled"] = 0] = "Enabled"; + getCommentVersions(project, workItemId, commentId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + workItemId: workItemId, + commentId: commentId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "49e03b34-3be0-42e3-8a5d-e8dfb88ac954", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentVersion, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * When paused the definition queue allows builds to be queued by users and the system will queue scheduled, gated and continuous integration builds. Builds in the queue will not be started by the system. + * Create a new field. + * + * @param {WorkItemTrackingInterfaces.WorkItemField} workItemField - New field definition + * @param {string} project - Project ID or project name */ - DefinitionQueueStatus[DefinitionQueueStatus["Paused"] = 1] = "Paused"; + createField(workItemField, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, workItemField, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * When disabled the definition queue will not allow builds to be queued by users and the system will not queue scheduled, gated or continuous integration builds. Builds already in the queue will not be started by the system. + * Deletes the field. To undelete a filed, see "Update Field" API. + * + * @param {string} fieldNameOrRefName - Field simple name or reference name + * @param {string} project - Project ID or project name */ - DefinitionQueueStatus[DefinitionQueueStatus["Disabled"] = 2] = "Disabled"; -})(DefinitionQueueStatus = exports.DefinitionQueueStatus || (exports.DefinitionQueueStatus = {})); -var DefinitionTriggerType; -(function (DefinitionTriggerType) { + deleteField(fieldNameOrRefName, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + fieldNameOrRefName: fieldNameOrRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Manual builds only. + * Gets information on a specific field. + * + * @param {string} fieldNameOrRefName - Field simple name or reference name + * @param {string} project - Project ID or project name */ - DefinitionTriggerType[DefinitionTriggerType["None"] = 1] = "None"; + getField(fieldNameOrRefName, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + fieldNameOrRefName: fieldNameOrRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * A build should be started for each changeset. + * Returns information for all fields. The project ID/name parameter is optional. + * + * @param {string} project - Project ID or project name + * @param {WorkItemTrackingInterfaces.GetFieldsExpand} expand - Use ExtensionFields to include extension fields, otherwise exclude them. Unless the feature flag for this parameter is enabled, extension fields are always included. */ - DefinitionTriggerType[DefinitionTriggerType["ContinuousIntegration"] = 2] = "ContinuousIntegration"; + getFields(project, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * A build should be started for multiple changesets at a time at a specified interval. + * Update a field. + * + * @param {WorkItemTrackingInterfaces.UpdateWorkItemField} payload - Payload contains desired value of the field's properties + * @param {string} fieldNameOrRefName - Name/reference name of the field to be updated + * @param {string} project - Project ID or project name */ - DefinitionTriggerType[DefinitionTriggerType["BatchedContinuousIntegration"] = 4] = "BatchedContinuousIntegration"; + updateField(payload, fieldNameOrRefName, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + fieldNameOrRefName: fieldNameOrRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, payload, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * A build should be started on a specified schedule whether or not changesets exist. + * Migrates a project to a different process within the same OOB type. For example, you can only migrate a project from agile/custom-agile to agile/custom-agile. + * + * @param {WorkItemTrackingInterfaces.ProcessIdModel} newProcess + * @param {string} project - Project ID or project name */ - DefinitionTriggerType[DefinitionTriggerType["Schedule"] = 8] = "Schedule"; + migrateProjectsProcess(newProcess, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "19801631-d4e5-47e9-8166-0330de0ff1e6", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, newProcess, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * A validation build should be started for each check-in. + * Creates a query, or moves a query. + * + * @param {WorkItemTrackingInterfaces.QueryHierarchyItem} postedQuery - The query to create. + * @param {string} project - Project ID or project name + * @param {string} query - The parent id or path under which the query is to be created. + * @param {boolean} validateWiqlOnly - If you only want to validate your WIQL query without actually creating one, set it to true. Default is false. */ - DefinitionTriggerType[DefinitionTriggerType["GatedCheckIn"] = 16] = "GatedCheckIn"; + createQuery(postedQuery, project, query, validateWiqlOnly) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + query: query + }; + let queryValues = { + validateWiqlOnly: validateWiqlOnly, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, postedQuery, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * A validation build should be started for each batch of check-ins. + * Delete a query or a folder. This deletes any permission change on the deleted query or folder and any of its descendants if it is a folder. It is important to note that the deleted permission changes cannot be recovered upon undeleting the query or folder. + * + * @param {string} project - Project ID or project name + * @param {string} query - ID or path of the query or folder to delete. */ - DefinitionTriggerType[DefinitionTriggerType["BatchedGatedCheckIn"] = 32] = "BatchedGatedCheckIn"; - /** - * A build should be triggered when a GitHub pull request is created or updated. Added in resource version 3 - */ - DefinitionTriggerType[DefinitionTriggerType["PullRequest"] = 64] = "PullRequest"; - /** - * A build should be triggered when another build completes. - */ - DefinitionTriggerType[DefinitionTriggerType["BuildCompletion"] = 128] = "BuildCompletion"; - /** - * All types. - */ - DefinitionTriggerType[DefinitionTriggerType["All"] = 255] = "All"; -})(DefinitionTriggerType = exports.DefinitionTriggerType || (exports.DefinitionTriggerType = {})); -var DefinitionType; -(function (DefinitionType) { - DefinitionType[DefinitionType["Xaml"] = 1] = "Xaml"; - DefinitionType[DefinitionType["Build"] = 2] = "Build"; -})(DefinitionType = exports.DefinitionType || (exports.DefinitionType = {})); -var DeleteOptions; -(function (DeleteOptions) { - /** - * No data should be deleted. This value should not be used. - */ - DeleteOptions[DeleteOptions["None"] = 0] = "None"; + deleteQuery(project, query) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + query: query + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The drop location should be deleted. + * Gets the root queries and their children + * + * @param {string} project - Project ID or project name + * @param {WorkItemTrackingInterfaces.QueryExpand} expand - Include the query string (wiql), clauses, query result columns, and sort options in the results. + * @param {number} depth - In the folder of queries, return child queries and folders to this depth. + * @param {boolean} includeDeleted - Include deleted queries and folders */ - DeleteOptions[DeleteOptions["DropLocation"] = 1] = "DropLocation"; + getQueries(project, expand, depth, includeDeleted) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + '$expand': expand, + '$depth': depth, + '$includeDeleted': includeDeleted, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The test results should be deleted. + * Retrieves an individual query and its children + * + * @param {string} project - Project ID or project name + * @param {string} query - ID or path of the query. + * @param {WorkItemTrackingInterfaces.QueryExpand} expand - Include the query string (wiql), clauses, query result columns, and sort options in the results. + * @param {number} depth - In the folder of queries, return child queries and folders to this depth. + * @param {boolean} includeDeleted - Include deleted queries and folders + * @param {boolean} useIsoDateFormat - DateTime query clauses will be formatted using a ISO 8601 compliant format */ - DeleteOptions[DeleteOptions["TestResults"] = 2] = "TestResults"; + getQuery(project, query, expand, depth, includeDeleted, useIsoDateFormat) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + query: query + }; + let queryValues = { + '$expand': expand, + '$depth': depth, + '$includeDeleted': includeDeleted, + '$useIsoDateFormat': useIsoDateFormat, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The version control label should be deleted. + * Searches all queries the user has access to in the current project + * + * @param {string} project - Project ID or project name + * @param {string} filter - The text to filter the queries with. + * @param {number} top - The number of queries to return (Default is 50 and maximum is 200). + * @param {WorkItemTrackingInterfaces.QueryExpand} expand + * @param {boolean} includeDeleted - Include deleted queries and folders */ - DeleteOptions[DeleteOptions["Label"] = 4] = "Label"; + searchQueries(project, filter, top, expand, includeDeleted) { + return __awaiter(this, void 0, void 0, function* () { + if (filter == null) { + throw new TypeError('filter can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + '$filter': filter, + '$top': top, + '$expand': expand, + '$includeDeleted': includeDeleted, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItemsResult, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The build should be deleted. + * Update a query or a folder. This allows you to update, rename and move queries and folders. + * + * @param {WorkItemTrackingInterfaces.QueryHierarchyItem} queryUpdate - The query to update. + * @param {string} project - Project ID or project name + * @param {string} query - The ID or path for the query to update. + * @param {boolean} undeleteDescendants - Undelete the children of this folder. It is important to note that this will not bring back the permission changes that were previously applied to the descendants. */ - DeleteOptions[DeleteOptions["Details"] = 8] = "Details"; + updateQuery(queryUpdate, project, query, undeleteDescendants) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + query: query + }; + let queryValues = { + '$undeleteDescendants': undeleteDescendants, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, queryUpdate, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Published symbols should be deleted. + * Gets a list of queries by ids (Maximum 1000) + * + * @param {WorkItemTrackingInterfaces.QueryBatchGetRequest} queryGetRequest + * @param {string} project - Project ID or project name */ - DeleteOptions[DeleteOptions["Symbols"] = 16] = "Symbols"; + getQueriesBatch(queryGetRequest, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "549816f9-09b0-4e75-9e81-01fbfcd07426", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, queryGetRequest, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * All data should be deleted. + * Destroys the specified work item permanently from the Recycle Bin. This action can not be undone. + * + * @param {number} id - ID of the work item to be destroyed permanently + * @param {string} project - Project ID or project name */ - DeleteOptions[DeleteOptions["All"] = 31] = "All"; -})(DeleteOptions = exports.DeleteOptions || (exports.DeleteOptions = {})); -/** - * Specifies the desired ordering of folders. - */ -var FolderQueryOrder; -(function (FolderQueryOrder) { + destroyWorkItem(id, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * No order + * Gets a deleted work item from Recycle Bin. + * + * @param {number} id - ID of the work item to be returned + * @param {string} project - Project ID or project name */ - FolderQueryOrder[FolderQueryOrder["None"] = 0] = "None"; + getDeletedWorkItem(id, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by folder name and path ascending. + * Gets the work items from the recycle bin, whose IDs have been specified in the parameters + * + * @param {number[]} ids - Comma separated list of IDs of the deleted work items to be returned + * @param {string} project - Project ID or project name */ - FolderQueryOrder[FolderQueryOrder["FolderAscending"] = 1] = "FolderAscending"; + getDeletedWorkItems(ids, project) { + return __awaiter(this, void 0, void 0, function* () { + if (ids == null) { + throw new TypeError('ids can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + ids: ids && ids.join(","), + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Order by folder name and path descending. + * Gets a list of the IDs and the URLs of the deleted the work items in the Recycle Bin. + * + * @param {string} project - Project ID or project name */ - FolderQueryOrder[FolderQueryOrder["FolderDescending"] = 2] = "FolderDescending"; -})(FolderQueryOrder = exports.FolderQueryOrder || (exports.FolderQueryOrder = {})); -var GetOption; -(function (GetOption) { + getDeletedWorkItemShallowReferences(project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Use the latest changeset at the time the build is queued. + * Restores the deleted work item from Recycle Bin. + * + * @param {WorkItemTrackingInterfaces.WorkItemDeleteUpdate} payload - Paylod with instructions to update the IsDeleted flag to false + * @param {number} id - ID of the work item to be restored + * @param {string} project - Project ID or project name */ - GetOption[GetOption["LatestOnQueue"] = 0] = "LatestOnQueue"; + restoreWorkItem(payload, id, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, payload, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Use the latest changeset at the time the build is started. + * Returns a fully hydrated work item for the requested revision + * + * @param {number} id + * @param {number} revisionNumber + * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand + * @param {string} project - Project ID or project name */ - GetOption[GetOption["LatestOnBuild"] = 1] = "LatestOnBuild"; + getRevision(id, revisionNumber, expand, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id, + revisionNumber: revisionNumber + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "a00c85a5-80fa-4565-99c3-bcd2181434bb", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * A user-specified version has been supplied. + * Returns the list of fully hydrated work item revisions, paged. + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand + * @param {string} project - Project ID or project name */ - GetOption[GetOption["Custom"] = 2] = "Custom"; -})(GetOption = exports.GetOption || (exports.GetOption = {})); -var IssueType; -(function (IssueType) { - IssueType[IssueType["Error"] = 1] = "Error"; - IssueType[IssueType["Warning"] = 2] = "Warning"; -})(IssueType = exports.IssueType || (exports.IssueType = {})); -var ProcessTemplateType; -(function (ProcessTemplateType) { + getRevisions(id, top, skip, expand, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + let queryValues = { + '$top': top, + '$skip': skip, + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "a00c85a5-80fa-4565-99c3-bcd2181434bb", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Indicates a custom template. + * RESTful method to send mail for selected/queried work items. + * + * @param {WorkItemTrackingInterfaces.SendMailBody} body + * @param {string} project - Project ID or project name */ - ProcessTemplateType[ProcessTemplateType["Custom"] = 0] = "Custom"; + sendMail(body, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "12438500-2f84-4fa7-9f1a-c31871b4959d", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, body, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Indicates a default template. + * @param {string} project - Project ID or project name + * @param {string} tagIdOrName */ - ProcessTemplateType[ProcessTemplateType["Default"] = 1] = "Default"; + deleteTag(project, tagIdOrName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + tagIdOrName: tagIdOrName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Indicates an upgrade template. + * @param {string} project - Project ID or project name + * @param {string} tagIdOrName */ - ProcessTemplateType[ProcessTemplateType["Upgrade"] = 2] = "Upgrade"; -})(ProcessTemplateType = exports.ProcessTemplateType || (exports.ProcessTemplateType = {})); -var QueryDeletedOption; -(function (QueryDeletedOption) { + getTag(project, tagIdOrName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + tagIdOrName: tagIdOrName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Include only non-deleted builds. + * @param {string} project - Project ID or project name */ - QueryDeletedOption[QueryDeletedOption["ExcludeDeleted"] = 0] = "ExcludeDeleted"; - /** - * Include deleted and non-deleted builds. - */ - QueryDeletedOption[QueryDeletedOption["IncludeDeleted"] = 1] = "IncludeDeleted"; - /** - * Include only deleted builds. - */ - QueryDeletedOption[QueryDeletedOption["OnlyDeleted"] = 2] = "OnlyDeleted"; -})(QueryDeletedOption = exports.QueryDeletedOption || (exports.QueryDeletedOption = {})); -var QueueOptions; -(function (QueueOptions) { - /** - * No queue options - */ - QueueOptions[QueueOptions["None"] = 0] = "None"; - /** - * Create a plan Id for the build, do not run it - */ - QueueOptions[QueueOptions["DoNotRun"] = 1] = "DoNotRun"; -})(QueueOptions = exports.QueueOptions || (exports.QueueOptions = {})); -var QueuePriority; -(function (QueuePriority) { + getTags(project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Low priority. + * @param {WorkItemTrackingInterfaces.WorkItemTagDefinition} tagData + * @param {string} project - Project ID or project name + * @param {string} tagIdOrName */ - QueuePriority[QueuePriority["Low"] = 5] = "Low"; + updateTag(tagData, project, tagIdOrName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + tagIdOrName: tagIdOrName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, tagData, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Below normal priority. + * Creates a template + * + * @param {WorkItemTrackingInterfaces.WorkItemTemplate} template - Template contents + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ - QueuePriority[QueuePriority["BelowNormal"] = 4] = "BelowNormal"; + createTemplate(template, teamContext) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "6a90345f-a676-4969-afce-8e163e1d5642", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, template, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Normal priority. + * Gets template + * + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} workitemtypename - Optional, When specified returns templates for given Work item type. */ - QueuePriority[QueuePriority["Normal"] = 3] = "Normal"; + getTemplates(teamContext, workitemtypename) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; + let queryValues = { + workitemtypename: workitemtypename, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "6a90345f-a676-4969-afce-8e163e1d5642", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Above normal priority. + * Deletes the template with given id + * + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} templateId - Template id */ - QueuePriority[QueuePriority["AboveNormal"] = 2] = "AboveNormal"; + deleteTemplate(teamContext, templateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + templateId: templateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "fb10264a-8836-48a0-8033-1b0ccd2748d5", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * High priority. + * Gets the template with specified id + * + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} templateId - Template Id */ - QueuePriority[QueuePriority["High"] = 1] = "High"; -})(QueuePriority = exports.QueuePriority || (exports.QueuePriority = {})); -var RepositoryCleanOptions; -(function (RepositoryCleanOptions) { - RepositoryCleanOptions[RepositoryCleanOptions["Source"] = 0] = "Source"; - RepositoryCleanOptions[RepositoryCleanOptions["SourceAndOutputDir"] = 1] = "SourceAndOutputDir"; + getTemplate(teamContext, templateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + templateId: templateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "fb10264a-8836-48a0-8033-1b0ccd2748d5", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Re-create $(build.sourcesDirectory) + * Replace template contents + * + * @param {WorkItemTrackingInterfaces.WorkItemTemplate} templateContent - Template contents to replace with + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {string} templateId - Template id */ - RepositoryCleanOptions[RepositoryCleanOptions["SourceDir"] = 2] = "SourceDir"; + replaceTemplate(templateContent, teamContext, templateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + templateId: templateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "fb10264a-8836-48a0-8033-1b0ccd2748d5", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, templateContent, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Re-create $(agnet.buildDirectory) which contains $(build.sourcesDirectory), $(build.binariesDirectory) and any folders that left from previous build. + * Returns a single update for a work item + * + * @param {number} id + * @param {number} updateNumber + * @param {string} project - Project ID or project name */ - RepositoryCleanOptions[RepositoryCleanOptions["AllBuildDir"] = 3] = "AllBuildDir"; -})(RepositoryCleanOptions = exports.RepositoryCleanOptions || (exports.RepositoryCleanOptions = {})); -var ResultSet; -(function (ResultSet) { + getUpdate(id, updateNumber, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id, + updateNumber: updateNumber + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "6570bf97-d02c-4a91-8d93-3abe9895b1a9", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemUpdate, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Include all repositories + * Returns a the deltas between work item revisions + * + * @param {number} id + * @param {number} top + * @param {number} skip + * @param {string} project - Project ID or project name */ - ResultSet[ResultSet["All"] = 0] = "All"; + getUpdates(id, top, skip, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + let queryValues = { + '$top': top, + '$skip': skip, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "6570bf97-d02c-4a91-8d93-3abe9895b1a9", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemUpdate, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Include most relevant repositories for user + * Gets the results of the query given its WIQL. + * + * @param {WorkItemTrackingInterfaces.Wiql} wiql - The query containing the WIQL. + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {boolean} timePrecision - Whether or not to use time precision. + * @param {number} top - The max number of results to return. */ - ResultSet[ResultSet["Top"] = 1] = "Top"; -})(ResultSet = exports.ResultSet || (exports.ResultSet = {})); -var ScheduleDays; -(function (ScheduleDays) { + queryByWiql(wiql, teamContext, timePrecision, top) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team + }; + let queryValues = { + timePrecision: timePrecision, + '$top': top, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "1a9c53f7-f243-4447-b110-35ef023636e4", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, wiql, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemQueryResult, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Do not run. + * Gets the results of the query given the query ID. + * + * @param {string} id - The query ID. + * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation + * @param {boolean} timePrecision - Whether or not to use time precision. + * @param {number} top - The max number of results to return. */ - ScheduleDays[ScheduleDays["None"] = 0] = "None"; + queryById(id, teamContext, timePrecision, top) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let project = null; + let team = null; + if (teamContext) { + project = teamContext.projectId || teamContext.project; + team = teamContext.teamId || teamContext.team; + } + let routeValues = { + project: project, + team: team, + id: id + }; + let queryValues = { + timePrecision: timePrecision, + '$top': top, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a02355f5-5f8a-4671-8e32-369d23aac83d", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemQueryResult, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Run on Monday. + * Get a work item icon given the friendly name and icon color. + * + * @param {string} icon - The name of the icon + * @param {string} color - The 6-digit hex color for the icon + * @param {number} v - The version of the icon (used only for cache invalidation) */ - ScheduleDays[ScheduleDays["Monday"] = 1] = "Monday"; + getWorkItemIconJson(icon, color, v) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + icon: icon + }; + let queryValues = { + color: color, + v: v, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Run on Tuesday. + * Get a list of all work item icons. + * */ - ScheduleDays[ScheduleDays["Tuesday"] = 2] = "Tuesday"; + getWorkItemIcons() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Run on Wednesday. + * Get a work item icon given the friendly name and icon color. + * + * @param {string} icon - The name of the icon + * @param {string} color - The 6-digit hex color for the icon + * @param {number} v - The version of the icon (used only for cache invalidation) */ - ScheduleDays[ScheduleDays["Wednesday"] = 4] = "Wednesday"; + getWorkItemIconSvg(icon, color, v) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + icon: icon + }; + let queryValues = { + color: color, + v: v, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues, queryValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("image/svg+xml", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Run on Thursday. + * Get a work item icon given the friendly name and icon color. + * + * @param {string} icon - The name of the icon + * @param {string} color - The 6-digit hex color for the icon + * @param {number} v - The version of the icon (used only for cache invalidation) */ - ScheduleDays[ScheduleDays["Thursday"] = 8] = "Thursday"; + getWorkItemIconXaml(icon, color, v) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + icon: icon + }; + let queryValues = { + color: color, + v: v, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues, queryValues); + let url = verData.requestUrl; + let apiVersion = verData.apiVersion; + let accept = this.createAcceptHeader("image/xaml+xml", apiVersion); + resolve((yield this.http.get(url, { "Accept": accept })).message); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Run on Friday. + * Get a batch of work item links + * + * @param {string} project - Project ID or project name + * @param {string[]} linkTypes - A list of types to filter the results to specific link types. Omit this parameter to get work item links of all link types. + * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types. + * @param {string} continuationToken - Specifies the continuationToken to start the batch from. Omit this parameter to get the first batch of links. + * @param {Date} startDateTime - Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter. */ - ScheduleDays[ScheduleDays["Friday"] = 16] = "Friday"; + getReportingLinksByLinkType(project, linkTypes, types, continuationToken, startDateTime) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + linkTypes: linkTypes && linkTypes.join(","), + types: types && types.join(","), + continuationToken: continuationToken, + startDateTime: startDateTime, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "b5b5b6d0-0308-40a1-b3f4-b9bb3c66878f", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Run on Saturday. + * Gets the work item relation type definition. + * + * @param {string} relation - The relation name */ - ScheduleDays[ScheduleDays["Saturday"] = 32] = "Saturday"; + getRelationType(relation) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + relation: relation + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Run on Sunday. + * Gets the work item relation types. + * */ - ScheduleDays[ScheduleDays["Sunday"] = 64] = "Sunday"; + getRelationTypes() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * Run on all days of the week. + * Get a batch of work item revisions with the option of including deleted items + * + * @param {string} project - Project ID or project name + * @param {string[]} fields - A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. + * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. + * @param {string} continuationToken - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. + * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. + * @param {boolean} includeIdentityRef - Return an identity reference instead of a string value for identity fields. + * @param {boolean} includeDeleted - Specify if the deleted item should be returned. + * @param {boolean} includeTagRef - Specify if the tag objects should be returned for System.Tags field. + * @param {boolean} includeLatestOnly - Return only the latest revisions of work items, skipping all historical revisions + * @param {WorkItemTrackingInterfaces.ReportingRevisionsExpand} expand - Return all the fields in work item revisions, including long text fields which are not returned by default + * @param {boolean} includeDiscussionChangesOnly - Return only the those revisions of work items, where only history field was changed + * @param {number} maxPageSize - The maximum number of results to return in this batch */ - ScheduleDays[ScheduleDays["All"] = 127] = "All"; -})(ScheduleDays = exports.ScheduleDays || (exports.ScheduleDays = {})); -var ServiceHostStatus; -(function (ServiceHostStatus) { + readReportingRevisionsGet(project, fields, types, continuationToken, startDateTime, includeIdentityRef, includeDeleted, includeTagRef, includeLatestOnly, expand, includeDiscussionChangesOnly, maxPageSize) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + fields: fields && fields.join(","), + types: types && types.join(","), + continuationToken: continuationToken, + startDateTime: startDateTime, + includeIdentityRef: includeIdentityRef, + includeDeleted: includeDeleted, + includeTagRef: includeTagRef, + includeLatestOnly: includeLatestOnly, + '$expand': expand, + includeDiscussionChangesOnly: includeDiscussionChangesOnly, + '$maxPageSize': maxPageSize, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "f828fe59-dd87-495d-a17c-7a8d6211ca6c", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The service host is currently connected and accepting commands. + * Get a batch of work item revisions. This request may be used if your list of fields is large enough that it may run the URL over the length limit. + * + * @param {WorkItemTrackingInterfaces.ReportingWorkItemRevisionsFilter} filter - An object that contains request settings: field filter, type filter, identity format + * @param {string} project - Project ID or project name + * @param {string} continuationToken - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. + * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. + * @param {WorkItemTrackingInterfaces.ReportingRevisionsExpand} expand */ - ServiceHostStatus[ServiceHostStatus["Online"] = 1] = "Online"; + readReportingRevisionsPost(filter, project, continuationToken, startDateTime, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + continuationToken: continuationToken, + startDateTime: startDateTime, + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "f828fe59-dd87-495d-a17c-7a8d6211ca6c", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, filter, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The service host is currently disconnected and not accepting commands. + * @param {string} project - Project ID or project name + * @param {string} continuationToken + * @param {number} maxPageSize */ - ServiceHostStatus[ServiceHostStatus["Offline"] = 2] = "Offline"; -})(ServiceHostStatus = exports.ServiceHostStatus || (exports.ServiceHostStatus = {})); -var SourceProviderAvailability; -(function (SourceProviderAvailability) { + readReportingDiscussions(project, continuationToken, maxPageSize) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + continuationToken: continuationToken, + '$maxPageSize': maxPageSize, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "4a644469-90c5-4fcc-9a9f-be0827d369ec", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The source provider is available in the hosted environment. + * Creates a single work item. + * + * @param {VSSInterfaces.JsonPatchDocument} document - The JSON Patch document representing the work item + * @param {string} project - Project ID or project name + * @param {string} type - The work item type of the work item to create + * @param {boolean} validateOnly - Indicate if you only want to validate the changes without saving the work item + * @param {boolean} bypassRules - Do not enforce the work item type rules on this update + * @param {boolean} suppressNotifications - Do not fire any notifications for this change + * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. */ - SourceProviderAvailability[SourceProviderAvailability["Hosted"] = 1] = "Hosted"; + createWorkItem(customHeaders, document, project, type, validateOnly, bypassRules, suppressNotifications, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + type: type + }; + let queryValues = { + validateOnly: validateOnly, + bypassRules: bypassRules, + suppressNotifications: suppressNotifications, + '$expand': expand, + }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "application/json-patch+json"; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "62d3d110-0047-428c-ad3c-4fe872c91c74", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; + let res; + res = yield this.rest.create(url, document, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The source provider is available in the on-premises environment. + * Returns a single work item from a template. + * + * @param {string} project - Project ID or project name + * @param {string} type - The work item type name + * @param {string} fields - Comma-separated list of requested fields + * @param {Date} asOf - AsOf UTC date time string + * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. */ - SourceProviderAvailability[SourceProviderAvailability["OnPremises"] = 2] = "OnPremises"; + getWorkItemTemplate(project, type, fields, asOf, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + type: type + }; + let queryValues = { + fields: fields, + asOf: asOf, + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "62d3d110-0047-428c-ad3c-4fe872c91c74", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The source provider is available in all environments. + * Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. + * + * @param {number} id - ID of the work item to be deleted + * @param {string} project - Project ID or project name + * @param {boolean} destroy - Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. */ - SourceProviderAvailability[SourceProviderAvailability["All"] = 3] = "All"; -})(SourceProviderAvailability = exports.SourceProviderAvailability || (exports.SourceProviderAvailability = {})); -var StageUpdateType; -(function (StageUpdateType) { - StageUpdateType[StageUpdateType["Cancel"] = 0] = "Cancel"; - StageUpdateType[StageUpdateType["Retry"] = 1] = "Retry"; -})(StageUpdateType = exports.StageUpdateType || (exports.StageUpdateType = {})); -var SupportLevel; -(function (SupportLevel) { + deleteWorkItem(id, project, destroy) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + let queryValues = { + destroy: destroy, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The functionality is not supported. + * Returns a single work item. + * + * @param {number} id - The work item id + * @param {string[]} fields - Comma-separated list of requested fields + * @param {Date} asOf - AsOf UTC date time string + * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. + * @param {string} project - Project ID or project name */ - SupportLevel[SupportLevel["Unsupported"] = 0] = "Unsupported"; + getWorkItem(id, fields, asOf, expand, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + let queryValues = { + fields: fields && fields.join(","), + asOf: asOf, + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The functionality is supported. + * Returns a list of work items (Maximum 200) + * + * @param {number[]} ids - The comma-separated list of requested work item ids. (Maximum 200 ids allowed). + * @param {string[]} fields - Comma-separated list of requested fields + * @param {Date} asOf - AsOf UTC date time string + * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. + * @param {WorkItemTrackingInterfaces.WorkItemErrorPolicy} errorPolicy - The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}. + * @param {string} project - Project ID or project name */ - SupportLevel[SupportLevel["Supported"] = 1] = "Supported"; + getWorkItems(ids, fields, asOf, expand, errorPolicy, project) { + return __awaiter(this, void 0, void 0, function* () { + if (ids == null) { + throw new TypeError('ids can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + let queryValues = { + ids: ids && ids.join(","), + fields: fields && fields.join(","), + asOf: asOf, + '$expand': expand, + errorPolicy: errorPolicy, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The functionality is required. + * Updates a single work item. + * + * @param {VSSInterfaces.JsonPatchDocument} document - The JSON Patch document representing the update + * @param {number} id - The id of the work item to update + * @param {string} project - Project ID or project name + * @param {boolean} validateOnly - Indicate if you only want to validate the changes without saving the work item + * @param {boolean} bypassRules - Do not enforce the work item type rules on this update + * @param {boolean} suppressNotifications - Do not fire any notifications for this change + * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. */ - SupportLevel[SupportLevel["Required"] = 2] = "Required"; -})(SupportLevel = exports.SupportLevel || (exports.SupportLevel = {})); -var TaskResult; -(function (TaskResult) { - TaskResult[TaskResult["Succeeded"] = 0] = "Succeeded"; - TaskResult[TaskResult["SucceededWithIssues"] = 1] = "SucceededWithIssues"; - TaskResult[TaskResult["Failed"] = 2] = "Failed"; - TaskResult[TaskResult["Canceled"] = 3] = "Canceled"; - TaskResult[TaskResult["Skipped"] = 4] = "Skipped"; - TaskResult[TaskResult["Abandoned"] = 5] = "Abandoned"; -})(TaskResult = exports.TaskResult || (exports.TaskResult = {})); -var TimelineRecordState; -(function (TimelineRecordState) { - TimelineRecordState[TimelineRecordState["Pending"] = 0] = "Pending"; - TimelineRecordState[TimelineRecordState["InProgress"] = 1] = "InProgress"; - TimelineRecordState[TimelineRecordState["Completed"] = 2] = "Completed"; -})(TimelineRecordState = exports.TimelineRecordState || (exports.TimelineRecordState = {})); -var ValidationResult; -(function (ValidationResult) { - ValidationResult[ValidationResult["OK"] = 0] = "OK"; - ValidationResult[ValidationResult["Warning"] = 1] = "Warning"; - ValidationResult[ValidationResult["Error"] = 2] = "Error"; -})(ValidationResult = exports.ValidationResult || (exports.ValidationResult = {})); -var WorkspaceMappingType; -(function (WorkspaceMappingType) { + updateWorkItem(customHeaders, document, id, project, validateOnly, bypassRules, suppressNotifications, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + id: id + }; + let queryValues = { + validateOnly: validateOnly, + bypassRules: bypassRules, + suppressNotifications: suppressNotifications, + '$expand': expand, + }; + customHeaders = customHeaders || {}; + customHeaders["Content-Type"] = "application/json-patch+json"; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + options.additionalHeaders = customHeaders; + let res; + res = yield this.rest.update(url, document, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The path is mapped in the workspace. + * Gets work items for a list of work item ids (Maximum 200) + * + * @param {WorkItemTrackingInterfaces.WorkItemBatchGetRequest} workItemGetRequest + * @param {string} project - Project ID or project name */ - WorkspaceMappingType[WorkspaceMappingType["Map"] = 0] = "Map"; + getWorkItemsBatch(workItemGetRequest, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "908509b6-4248-4475-a1cd-829139ba419f", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, workItemGetRequest, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } /** - * The path is cloaked in the workspace. + * INTERNAL ONLY: It will be used for My account work experience. Get the work item type state color for multiple projects + * + * @param {string[]} projectNames */ - WorkspaceMappingType[WorkspaceMappingType["Cloak"] = 1] = "Cloak"; -})(WorkspaceMappingType = exports.WorkspaceMappingType || (exports.WorkspaceMappingType = {})); -exports.TypeInfo = { - AgentStatus: { - enumValues: { - "unavailable": 0, - "available": 1, - "offline": 2 - } - }, - AuditAction: { - enumValues: { - "add": 1, - "update": 2, - "delete": 3 - } - }, - Build: {}, - BuildAgent: {}, - BuildAuthorizationScope: { - enumValues: { - "projectCollection": 1, - "project": 2 - } - }, - BuildCompletedEvent: {}, - BuildCompletionTrigger: {}, - BuildController: {}, - BuildDefinition: {}, - BuildDefinition3_2: {}, - BuildDefinitionReference: {}, - BuildDefinitionReference3_2: {}, - BuildDefinitionRevision: {}, - BuildDefinitionSourceProvider: {}, - BuildDefinitionTemplate: {}, - BuildDefinitionTemplate3_2: {}, + getWorkItemStateColors(projectNames) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "0b83df8a-3496-4ddb-ba44-63634f4cda61", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, projectNames, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns the next state on the given work item IDs. + * + * @param {number[]} ids - list of work item ids + * @param {string} action - possible actions. Currently only supports checkin + */ + getWorkItemNextStatesOnCheckinAction(ids, action) { + return __awaiter(this, void 0, void 0, function* () { + if (ids == null) { + throw new TypeError('ids can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + ids: ids && ids.join(","), + action: action, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "afae844b-e2f6-44c2-8053-17b3bb936a40", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get all work item type categories. + * + * @param {string} project - Project ID or project name + */ + getWorkItemTypeCategories(project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "9b9f5734-36c8-415e-ba67-f83b45c31408", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get specific work item type category by name. + * + * @param {string} project - Project ID or project name + * @param {string} category - The category name + */ + getWorkItemTypeCategory(project, category) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + category: category + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "9b9f5734-36c8-415e-ba67-f83b45c31408", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * INTERNAL ONLY: It will be used for My account work experience. Get the wit type color for multiple projects + * + * @param {string[]} projectNames + */ + getWorkItemTypeColors(projectNames) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "958fde80-115e-43fb-bd65-749c48057faf", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, projectNames, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * INTERNAL ONLY: It is used for color and icon providers. Get the wit type color for multiple projects + * + * @param {string[]} projectNames + */ + getWorkItemTypeColorAndIcons(projectNames) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "f0f8dc62-3975-48ce-8051-f636b68b52e3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, projectNames, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a work item type definition. + * + * @param {string} project - Project ID or project name + * @param {string} type - Work item type name + */ + getWorkItemType(project, type) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + type: type + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns the list of work item types + * + * @param {string} project - Project ID or project name + */ + getWorkItemTypes(project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get a list of fields for a work item type with detailed references. + * + * @param {string} project - Project ID or project name + * @param {string} type - Work item type. + * @param {WorkItemTrackingInterfaces.WorkItemTypeFieldsExpandLevel} expand - Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties. + */ + getWorkItemTypeFieldsWithReferences(project, type, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + type: type + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "bd293ce5-3d25-4192-8e67-e8092e879efb", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get a field for a work item type with detailed references. + * + * @param {string} project - Project ID or project name + * @param {string} type - Work item type. + * @param {string} field + * @param {WorkItemTrackingInterfaces.WorkItemTypeFieldsExpandLevel} expand - Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties. + */ + getWorkItemTypeFieldWithReferences(project, type, field, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + type: type, + field: field + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "bd293ce5-3d25-4192-8e67-e8092e879efb", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns the state names and colors for a work item type. + * + * @param {string} project - Project ID or project name + * @param {string} type - The state name + */ + getWorkItemTypeStates(project, type) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + type: type + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "7c9d7a76-4a09-43e8-b5df-bd792f4ac6aa", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Export work item type + * + * @param {string} project - Project ID or project name + * @param {string} type + * @param {boolean} exportGlobalLists + */ + exportWorkItemTypeDefinition(project, type, exportGlobalLists) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project, + type: type + }; + let queryValues = { + exportGlobalLists: exportGlobalLists, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "8637ac8b-5eb6-4f90-b3f7-4f2ff576a459", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Add/updates a work item type + * + * @param {WorkItemTrackingInterfaces.WorkItemTypeTemplateUpdateModel} updateModel + * @param {string} project - Project ID or project name + */ + updateWorkItemTypeDefinition(updateModel, project) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + project: project + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "8637ac8b-5eb6-4f90-b3f7-4f2ff576a459", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, updateModel, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } +} +exports.WorkItemTrackingApi = WorkItemTrackingApi; +WorkItemTrackingApi.RESOURCE_AREA_ID = "5264459e-e5e0-4bd8-b118-0985e68a4ec5"; + + +/***/ }), + +/***/ 1178: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WorkItemTrackingProcessApi = void 0; +const basem = __nccwpck_require__(273); +const WorkItemTrackingProcessInterfaces = __nccwpck_require__(4524); +class WorkItemTrackingProcessApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-WorkItemTracking-api', options); + } + /** + * Creates a single behavior in the given process. + * + * @param {WorkItemTrackingProcessInterfaces.ProcessBehaviorCreateRequest} behavior + * @param {string} processId - The ID of the process + */ + createProcessBehavior(behavior, processId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, behavior, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a behavior in the process. + * + * @param {string} processId - The ID of the process + * @param {string} behaviorRefName - The reference name of the behavior + */ + deleteProcessBehavior(processId, behaviorRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + behaviorRefName: behaviorRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a behavior of the process. + * + * @param {string} processId - The ID of the process + * @param {string} behaviorRefName - The reference name of the behavior + * @param {WorkItemTrackingProcessInterfaces.GetBehaviorsExpand} expand + */ + getProcessBehavior(processId, behaviorRefName, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + behaviorRefName: behaviorRefName + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all behaviors in the process. + * + * @param {string} processId - The ID of the process + * @param {WorkItemTrackingProcessInterfaces.GetBehaviorsExpand} expand + */ + getProcessBehaviors(processId, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Replaces a behavior in the process. + * + * @param {WorkItemTrackingProcessInterfaces.ProcessBehaviorUpdateRequest} behaviorData + * @param {string} processId - The ID of the process + * @param {string} behaviorRefName - The reference name of the behavior + */ + updateProcessBehavior(behaviorData, processId, behaviorRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + behaviorRefName: behaviorRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, behaviorData, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a control in a group. + * + * @param {WorkItemTrackingProcessInterfaces.Control} control - The control. + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} groupId - The ID of the group to add the control to. + */ + createControlInGroup(control, processId, witRefName, groupId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + groupId: groupId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, control, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Moves a control to a specified group. + * + * @param {WorkItemTrackingProcessInterfaces.Control} control - The control. + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} groupId - The ID of the group to move the control to. + * @param {string} controlId - The ID of the control. + * @param {string} removeFromGroupId - The group ID to remove the control from. + */ + moveControlToGroup(control, processId, witRefName, groupId, controlId, removeFromGroupId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + groupId: groupId, + controlId: controlId + }; + let queryValues = { + removeFromGroupId: removeFromGroupId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, control, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a control from the work item form. + * + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} groupId - The ID of the group. + * @param {string} controlId - The ID of the control to remove. + */ + removeControlFromGroup(processId, witRefName, groupId, controlId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + groupId: groupId, + controlId: controlId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a control on the work item form. + * + * @param {WorkItemTrackingProcessInterfaces.Control} control - The updated control. + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} groupId - The ID of the group. + * @param {string} controlId - The ID of the control. + */ + updateControl(control, processId, witRefName, groupId, controlId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + groupId: groupId, + controlId: controlId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, control, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Adds a field to a work item type. + * + * @param {WorkItemTrackingProcessInterfaces.AddProcessWorkItemTypeFieldRequest} field + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + */ + addFieldToWorkItemType(field, processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, field, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all fields in a work item type. + * + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + */ + getAllWorkItemTypeFields(processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a field in a work item type. + * + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} fieldRefName - The reference name of the field. + * @param {WorkItemTrackingProcessInterfaces.ProcessWorkItemTypeFieldsExpandLevel} expand + */ + getWorkItemTypeField(processId, witRefName, fieldRefName, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + fieldRefName: fieldRefName + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a field from a work item type. Does not permanently delete the field. + * + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} fieldRefName - The reference name of the field. + */ + removeWorkItemTypeField(processId, witRefName, fieldRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + fieldRefName: fieldRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a field in a work item type. + * + * @param {WorkItemTrackingProcessInterfaces.UpdateProcessWorkItemTypeFieldRequest} field + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} fieldRefName - The reference name of the field. + */ + updateWorkItemTypeField(field, processId, witRefName, fieldRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + fieldRefName: fieldRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, field, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Adds a group to the work item form. + * + * @param {WorkItemTrackingProcessInterfaces.Group} group - The group. + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} pageId - The ID of the page to add the group to. + * @param {string} sectionId - The ID of the section to add the group to. + */ + addGroup(group, processId, witRefName, pageId, sectionId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId, + sectionId: sectionId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, group, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Moves a group to a different page and section. + * + * @param {WorkItemTrackingProcessInterfaces.Group} group - The updated group. + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} pageId - The ID of the page the group is in. + * @param {string} sectionId - The ID of the section the group is i.n + * @param {string} groupId - The ID of the group. + * @param {string} removeFromPageId - ID of the page to remove the group from. + * @param {string} removeFromSectionId - ID of the section to remove the group from. + */ + moveGroupToPage(group, processId, witRefName, pageId, sectionId, groupId, removeFromPageId, removeFromSectionId) { + return __awaiter(this, void 0, void 0, function* () { + if (removeFromPageId == null) { + throw new TypeError('removeFromPageId can not be null or undefined'); + } + if (removeFromSectionId == null) { + throw new TypeError('removeFromSectionId can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId, + sectionId: sectionId, + groupId: groupId + }; + let queryValues = { + removeFromPageId: removeFromPageId, + removeFromSectionId: removeFromSectionId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, group, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Moves a group to a different section. + * + * @param {WorkItemTrackingProcessInterfaces.Group} group - The updated group. + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} pageId - The ID of the page the group is in. + * @param {string} sectionId - The ID of the section the group is in. + * @param {string} groupId - The ID of the group. + * @param {string} removeFromSectionId - ID of the section to remove the group from. + */ + moveGroupToSection(group, processId, witRefName, pageId, sectionId, groupId, removeFromSectionId) { + return __awaiter(this, void 0, void 0, function* () { + if (removeFromSectionId == null) { + throw new TypeError('removeFromSectionId can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId, + sectionId: sectionId, + groupId: groupId + }; + let queryValues = { + removeFromSectionId: removeFromSectionId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, group, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a group from the work item form. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} pageId - The ID of the page the group is in + * @param {string} sectionId - The ID of the section to the group is in + * @param {string} groupId - The ID of the group + */ + removeGroup(processId, witRefName, pageId, sectionId, groupId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId, + sectionId: sectionId, + groupId: groupId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a group in the work item form. + * + * @param {WorkItemTrackingProcessInterfaces.Group} group - The updated group. + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} pageId - The ID of the page the group is in. + * @param {string} sectionId - The ID of the section the group is in. + * @param {string} groupId - The ID of the group. + */ + updateGroup(group, processId, witRefName, pageId, sectionId, groupId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId, + sectionId: sectionId, + groupId: groupId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, group, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Gets the form layout. + * + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + */ + getFormLayout(processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "fa8646eb-43cd-4b71-9564-40106fd63e40", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.FormLayout, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a picklist. + * + * @param {WorkItemTrackingProcessInterfaces.PickList} picklist - Picklist + */ + createList(picklist) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, picklist, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a picklist. + * + * @param {string} listId - The ID of the list + */ + deleteList(listId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + listId: listId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a picklist. + * + * @param {string} listId - The ID of the list + */ + getList(listId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + listId: listId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns meta data of the picklist. + * + */ + getListsMetadata() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a list. + * + * @param {WorkItemTrackingProcessInterfaces.PickList} picklist + * @param {string} listId - The ID of the list + */ + updateList(picklist, listId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + listId: listId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, picklist, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Adds a page to the work item form. + * + * @param {WorkItemTrackingProcessInterfaces.Page} page - The page. + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + */ + addPage(page, processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1cc7b29f-6697-4d9d-b0a1-2650d3e1d584", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, page, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.Page, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a page from the work item form + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} pageId - The ID of the page + */ + removePage(processId, witRefName, pageId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1cc7b29f-6697-4d9d-b0a1-2650d3e1d584", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a page on the work item form + * + * @param {WorkItemTrackingProcessInterfaces.Page} page - The page + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + updatePage(page, processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1cc7b29f-6697-4d9d-b0a1-2650d3e1d584", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, page, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.Page, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a process. + * + * @param {WorkItemTrackingProcessInterfaces.CreateProcessModel} createRequest - CreateProcessModel. + */ + createNewProcess(createRequest) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, createRequest, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a process of a specific ID. + * + * @param {string} processTypeId + */ + deleteProcessById(processTypeId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processTypeId: processTypeId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Edit a process of a specific ID. + * + * @param {WorkItemTrackingProcessInterfaces.UpdateProcessModel} updateRequest + * @param {string} processTypeId + */ + editProcess(updateRequest, processTypeId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processTypeId: processTypeId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, updateRequest, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get list of all processes including system and inherited. + * + * @param {WorkItemTrackingProcessInterfaces.GetProcessExpandLevel} expand + */ + getListOfProcesses(expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Get a single process of a specified ID. + * + * @param {string} processTypeId + * @param {WorkItemTrackingProcessInterfaces.GetProcessExpandLevel} expand + */ + getProcessByItsId(processTypeId, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processTypeId: processTypeId + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Adds a rule to work item type in the process. + * + * @param {WorkItemTrackingProcessInterfaces.CreateProcessRuleRequest} processRuleCreate + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + addProcessWorkItemTypeRule(processRuleCreate, processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, processRuleCreate, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a rule from the work item type in the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} ruleId - The ID of the rule + */ + deleteProcessWorkItemTypeRule(processId, witRefName, ruleId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + ruleId: ruleId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a single rule in the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} ruleId - The ID of the rule + */ + getProcessWorkItemTypeRule(processId, witRefName, ruleId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + ruleId: ruleId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all rules in the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + getProcessWorkItemTypeRules(processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a rule in the work item type of the process. + * + * @param {WorkItemTrackingProcessInterfaces.UpdateProcessRuleRequest} processRule + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} ruleId - The ID of the rule + */ + updateProcessWorkItemTypeRule(processRule, processId, witRefName, ruleId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + ruleId: ruleId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, processRule, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a state definition in the work item type of the process. + * + * @param {WorkItemTrackingProcessInterfaces.WorkItemStateInputModel} stateModel + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + createStateDefinition(stateModel, processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, stateModel, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a state definition in the work item type of the process. + * + * @param {string} processId - ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} stateId - ID of the state + */ + deleteStateDefinition(processId, witRefName, stateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + stateId: stateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a single state definition in a work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} stateId - The ID of the state + */ + getStateDefinition(processId, witRefName, stateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + stateId: stateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all state definitions in a work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + getStateDefinitions(processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Hides a state definition in the work item type of the process.Only states with customizationType:System can be hidden. + * + * @param {WorkItemTrackingProcessInterfaces.HideStateModel} hideStateModel + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} stateId - The ID of the state + */ + hideStateDefinition(hideStateModel, processId, witRefName, stateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + stateId: stateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, hideStateModel, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a given state definition in the work item type of the process. + * + * @param {WorkItemTrackingProcessInterfaces.WorkItemStateInputModel} stateModel + * @param {string} processId - ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} stateId - ID of the state + */ + updateStateDefinition(stateModel, processId, witRefName, stateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + stateId: stateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, stateModel, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Deletes a system control modification on the work item form. + * + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} controlId - The ID of the control. + */ + deleteSystemControl(processId, witRefName, controlId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + controlId: controlId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "ff9a3d2c-32b7-4c6c-991c-d5a251fb9098", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Gets edited system controls for a work item type in a process. To get all system controls (base + edited) use layout API(s) + * + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + */ + getSystemControls(processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "ff9a3d2c-32b7-4c6c-991c-d5a251fb9098", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates/adds a system control on the work item form. + * + * @param {WorkItemTrackingProcessInterfaces.Control} control + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + * @param {string} controlId - The ID of the control. + */ + updateSystemControl(control, processId, witRefName, controlId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + controlId: controlId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "ff9a3d2c-32b7-4c6c-991c-d5a251fb9098", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, control, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a work item type in the process. + * + * @param {WorkItemTrackingProcessInterfaces.CreateProcessWorkItemTypeRequest} workItemType + * @param {string} processId - The ID of the process on which to create work item type. + */ + createProcessWorkItemType(workItemType, processId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, workItemType, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a work item type in the process. + * + * @param {string} processId - The ID of the process. + * @param {string} witRefName - The reference name of the work item type. + */ + deleteProcessWorkItemType(processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a single work item type in a process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {WorkItemTrackingProcessInterfaces.GetWorkItemTypeExpand} expand - Flag to determine what properties of work item type to return + */ + getProcessWorkItemType(processId, witRefName, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all work item types in a process. + * + * @param {string} processId - The ID of the process + * @param {WorkItemTrackingProcessInterfaces.GetWorkItemTypeExpand} expand - Flag to determine what properties of work item type to return + */ + getProcessWorkItemTypes(processId, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a work item type of the process. + * + * @param {WorkItemTrackingProcessInterfaces.UpdateProcessWorkItemTypeRequest} workItemTypeUpdate + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + updateProcessWorkItemType(workItemTypeUpdate, processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, workItemTypeUpdate, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Adds a behavior to the work item type of the process. + * + * @param {WorkItemTrackingProcessInterfaces.WorkItemTypeBehavior} behavior + * @param {string} processId - The ID of the process + * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + */ + addBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForBehaviors: witRefNameForBehaviors + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, behavior, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a behavior for the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + * @param {string} behaviorRefName - The reference name of the behavior + */ + getBehaviorForWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForBehaviors: witRefNameForBehaviors, + behaviorRefName: behaviorRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all behaviors for the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + */ + getBehaviorsForWorkItemType(processId, witRefNameForBehaviors) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForBehaviors: witRefNameForBehaviors + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a behavior for the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + * @param {string} behaviorRefName - The reference name of the behavior + */ + removeBehaviorFromWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForBehaviors: witRefNameForBehaviors, + behaviorRefName: behaviorRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a behavior for the work item type of the process. + * + * @param {WorkItemTrackingProcessInterfaces.WorkItemTypeBehavior} behavior + * @param {string} processId - The ID of the process + * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + */ + updateBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForBehaviors: witRefNameForBehaviors + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, behavior, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } +} +exports.WorkItemTrackingProcessApi = WorkItemTrackingProcessApi; +WorkItemTrackingProcessApi.RESOURCE_AREA_ID = "5264459e-e5e0-4bd8-b118-0985e68a4ec5"; + + +/***/ }), + +/***/ 3333: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WorkItemTrackingProcessDefinitionsApi = void 0; +const basem = __nccwpck_require__(273); +const WorkItemTrackingProcessDefinitionsInterfaces = __nccwpck_require__(1655); +class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase { + constructor(baseUrl, handlers, options, userAgent) { + super(baseUrl, handlers, userAgent || 'node-WorkItemTracking-api', options); + } + /** + * Creates a single behavior in the given process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.BehaviorCreateModel} behavior + * @param {string} processId - The ID of the process + */ + createBehavior(behavior, processId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, behavior, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a behavior in the process. + * + * @param {string} processId - The ID of the process + * @param {string} behaviorId - The ID of the behavior + */ + deleteBehavior(processId, behaviorId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + behaviorId: behaviorId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a single behavior in the process. + * + * @param {string} processId - The ID of the process + * @param {string} behaviorId - The ID of the behavior + */ + getBehavior(processId, behaviorId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + behaviorId: behaviorId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all behaviors in the process. + * + * @param {string} processId - The ID of the process + */ + getBehaviors(processId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Replaces a behavior in the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.BehaviorReplaceModel} behaviorData + * @param {string} processId - The ID of the process + * @param {string} behaviorId - The ID of the behavior + */ + replaceBehavior(behaviorData, processId, behaviorId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + behaviorId: behaviorId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, behaviorData, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a control in a group + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.Control} control - The control + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} groupId - The ID of the group to add the control to + */ + addControlToGroup(control, processId, witRefName, groupId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + groupId: groupId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, control, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a control on the work item form + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.Control} control - The updated control + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} groupId - The ID of the group + * @param {string} controlId - The ID of the control + */ + editControl(control, processId, witRefName, groupId, controlId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + groupId: groupId, + controlId: controlId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, control, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a control from the work item form + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} groupId - The ID of the group + * @param {string} controlId - The ID of the control to remove + */ + removeControlFromGroup(processId, witRefName, groupId, controlId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + groupId: groupId, + controlId: controlId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Moves a control to a new group + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.Control} control - The control + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} groupId - The ID of the group to move the control to + * @param {string} controlId - The id of the control + * @param {string} removeFromGroupId - The group to remove the control from + */ + setControlInGroup(control, processId, witRefName, groupId, controlId, removeFromGroupId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + groupId: groupId, + controlId: controlId + }; + let queryValues = { + removeFromGroupId: removeFromGroupId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, control, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a single field in the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.FieldModel} field + * @param {string} processId - The ID of the process + */ + createField(field, processId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "f36c66c7-911d-4163-8938-d3c5d0d7f5aa", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, field, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.FieldModel, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a given field in the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.FieldUpdate} field + * @param {string} processId - The ID of the process + */ + updateField(field, processId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "f36c66c7-911d-4163-8938-d3c5d0d7f5aa", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, field, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.FieldModel, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Adds a group to the work item form + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.Group} group - The group + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} pageId - The ID of the page to add the group to + * @param {string} sectionId - The ID of the section to add the group to + */ + addGroup(group, processId, witRefName, pageId, sectionId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId, + sectionId: sectionId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, group, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a group in the work item form + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.Group} group - The updated group + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} pageId - The ID of the page the group is in + * @param {string} sectionId - The ID of the section the group is in + * @param {string} groupId - The ID of the group + */ + editGroup(group, processId, witRefName, pageId, sectionId, groupId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId, + sectionId: sectionId, + groupId: groupId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, group, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a group from the work item form + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} pageId - The ID of the page the group is in + * @param {string} sectionId - The ID of the section to the group is in + * @param {string} groupId - The ID of the group + */ + removeGroup(processId, witRefName, pageId, sectionId, groupId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId, + sectionId: sectionId, + groupId: groupId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Moves a group to a different page and section + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.Group} group - The updated group + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} pageId - The ID of the page the group is in + * @param {string} sectionId - The ID of the section the group is in + * @param {string} groupId - The ID of the group + * @param {string} removeFromPageId - ID of the page to remove the group from + * @param {string} removeFromSectionId - ID of the section to remove the group from + */ + setGroupInPage(group, processId, witRefName, pageId, sectionId, groupId, removeFromPageId, removeFromSectionId) { + return __awaiter(this, void 0, void 0, function* () { + if (removeFromPageId == null) { + throw new TypeError('removeFromPageId can not be null or undefined'); + } + if (removeFromSectionId == null) { + throw new TypeError('removeFromSectionId can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId, + sectionId: sectionId, + groupId: groupId + }; + let queryValues = { + removeFromPageId: removeFromPageId, + removeFromSectionId: removeFromSectionId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, group, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Moves a group to a different section + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.Group} group - The updated group + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} pageId - The ID of the page the group is in + * @param {string} sectionId - The ID of the section the group is in + * @param {string} groupId - The ID of the group + * @param {string} removeFromSectionId - ID of the section to remove the group from + */ + setGroupInSection(group, processId, witRefName, pageId, sectionId, groupId, removeFromSectionId) { + return __awaiter(this, void 0, void 0, function* () { + if (removeFromSectionId == null) { + throw new TypeError('removeFromSectionId can not be null or undefined'); + } + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId, + sectionId: sectionId, + groupId: groupId + }; + let queryValues = { + removeFromSectionId: removeFromSectionId, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, group, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Gets the form layout + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + getFormLayout(processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "3eacc80a-ddca-4404-857a-6331aac99063", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.FormLayout, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns meta data of the picklist. + * + */ + getListsMetadata() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "b45cc931-98e3-44a1-b1cd-2e8e9c6dc1c6", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a picklist. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.PickListModel} picklist + */ + createList(picklist) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = {}; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, picklist, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a picklist. + * + * @param {string} listId - The ID of the list + */ + deleteList(listId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + listId: listId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a picklist. + * + * @param {string} listId - The ID of the list + */ + getList(listId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + listId: listId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a list. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.PickListModel} picklist + * @param {string} listId - The ID of the list + */ + updateList(picklist, listId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + listId: listId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, picklist, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Adds a page to the work item form + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.Page} page - The page + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + addPage(page, processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1b4ac126-59b2-4f37-b4df-0a48ba807edb", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, page, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.Page, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a page on the work item form + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.Page} page - The page + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + editPage(page, processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1b4ac126-59b2-4f37-b4df-0a48ba807edb", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, page, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.Page, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a page from the work item form + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} pageId - The ID of the page + */ + removePage(processId, witRefName, pageId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + pageId: pageId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1b4ac126-59b2-4f37-b4df-0a48ba807edb", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a state definition in the work item type of the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemStateInputModel} stateModel + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + createStateDefinition(stateModel, processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, stateModel, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a state definition in the work item type of the process. + * + * @param {string} processId - ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} stateId - ID of the state + */ + deleteStateDefinition(processId, witRefName, stateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + stateId: stateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a state definition in the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} stateId - The ID of the state + */ + getStateDefinition(processId, witRefName, stateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + stateId: stateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all state definitions in the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + getStateDefinitions(processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Hides a state definition in the work item type of the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.HideStateModel} hideStateModel + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} stateId - The ID of the state + */ + hideStateDefinition(hideStateModel, processId, witRefName, stateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + stateId: stateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.replace(url, hideStateModel, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a given state definition in the work item type of the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemStateInputModel} stateModel + * @param {string} processId - ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {string} stateId - ID of the state + */ + updateStateDefinition(stateModel, processId, witRefName, stateId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName, + stateId: stateId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, stateModel, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Adds a behavior to the work item type of the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeBehavior} behavior + * @param {string} processId - The ID of the process + * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + */ + addBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForBehaviors: witRefNameForBehaviors + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, behavior, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a behavior for the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + * @param {string} behaviorRefName - The reference name of the behavior + */ + getBehaviorForWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForBehaviors: witRefNameForBehaviors, + behaviorRefName: behaviorRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all behaviors for the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + */ + getBehaviorsForWorkItemType(processId, witRefNameForBehaviors) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForBehaviors: witRefNameForBehaviors + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, null, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a behavior for the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + * @param {string} behaviorRefName - The reference name of the behavior + */ + removeBehaviorFromWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForBehaviors: witRefNameForBehaviors, + behaviorRefName: behaviorRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates default work item type for the behavior of the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeBehavior} behavior + * @param {string} processId - The ID of the process + * @param {string} witRefNameForBehaviors - Work item type reference name for the behavior + */ + updateBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForBehaviors: witRefNameForBehaviors + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, behavior, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Creates a work item type in the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeModel} workItemType + * @param {string} processId - The ID of the process + */ + createWorkItemType(workItemType, processId) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, workItemType, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a work item type in the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + deleteWorkItemType(processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + * @param {WorkItemTrackingProcessDefinitionsInterfaces.GetWorkItemTypeExpand} expand + */ + getWorkItemType(processId, witRefName, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all work item types in the process. + * + * @param {string} processId - The ID of the process + * @param {WorkItemTrackingProcessDefinitionsInterfaces.GetWorkItemTypeExpand} expand + */ + getWorkItemTypes(processId, expand) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId + }; + let queryValues = { + '$expand': expand, + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues, queryValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a work item type of the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeUpdateModel} workItemTypeUpdate + * @param {string} processId - The ID of the process + * @param {string} witRefName - The reference name of the work item type + */ + updateWorkItemType(workItemTypeUpdate, processId, witRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefName: witRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, workItemTypeUpdate, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Adds a field to the work item type in the process. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeFieldModel2} field + * @param {string} processId - The ID of the process + * @param {string} witRefNameForFields - Work item type reference name for the field + */ + addFieldToWorkItemType(field, processId, witRefNameForFields) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForFields: witRefNameForFields + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.create(url, field, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a single field in the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefNameForFields - Work item type reference name for fields + * @param {string} fieldRefName - The reference name of the field + */ + getWorkItemTypeField(processId, witRefNameForFields, fieldRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForFields: witRefNameForFields, + fieldRefName: fieldRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Returns a list of all fields in the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefNameForFields - Work item type reference name for fields + */ + getWorkItemTypeFields(processId, witRefNameForFields) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForFields: witRefNameForFields + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.get(url, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, true); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Removes a field in the work item type of the process. + * + * @param {string} processId - The ID of the process + * @param {string} witRefNameForFields - Work item type reference name for fields + * @param {string} fieldRefName - The reference name of the field + */ + removeFieldFromWorkItemType(processId, witRefNameForFields, fieldRefName) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForFields: witRefNameForFields, + fieldRefName: fieldRefName + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.del(url, options); + let ret = this.formatResponse(res.result, null, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } + /** + * Updates a single field in the scope of the given process and work item type. + * + * @param {WorkItemTrackingProcessDefinitionsInterfaces.WorkItemTypeFieldModel2} field - The model with which to update the field + * @param {string} processId - The ID of the process + * @param {string} witRefNameForFields - Work item type reference name for fields + */ + updateWorkItemTypeField(field, processId, witRefNameForFields) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + let routeValues = { + processId: processId, + witRefNameForFields: witRefNameForFields + }; + try { + let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues); + let url = verData.requestUrl; + let options = this.createRequestOptions('application/json', verData.apiVersion); + let res; + res = yield this.rest.update(url, field, options); + let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, false); + resolve(ret); + } + catch (err) { + reject(err); + } + })); + }); + } +} +exports.WorkItemTrackingProcessDefinitionsApi = WorkItemTrackingProcessDefinitionsApi; +WorkItemTrackingProcessDefinitionsApi.RESOURCE_AREA_ID = "5264459e-e5e0-4bd8-b118-0985e68a4ec5"; + + +/***/ }), + +/***/ 6456: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BasicCredentialHandler = void 0; +const resthandlers = __nccwpck_require__(4442); +class BasicCredentialHandler extends resthandlers.BasicCredentialHandler { + constructor(username, password, allowCrossOriginAuthentication = true) { + super(username, password, allowCrossOriginAuthentication); + } +} +exports.BasicCredentialHandler = BasicCredentialHandler; + + +/***/ }), + +/***/ 1141: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BearerCredentialHandler = void 0; +const resthandlers = __nccwpck_require__(4442); +class BearerCredentialHandler extends resthandlers.BearerCredentialHandler { + constructor(token, allowCrossOriginAuthentication = true) { + super(token, allowCrossOriginAuthentication); + } +} +exports.BearerCredentialHandler = BearerCredentialHandler; + + +/***/ }), + +/***/ 3450: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NtlmCredentialHandler = void 0; +const resthandlers = __nccwpck_require__(4442); +class NtlmCredentialHandler extends resthandlers.NtlmCredentialHandler { + constructor(username, password, workstation, domain) { + super(username, password, workstation, domain); + } +} +exports.NtlmCredentialHandler = NtlmCredentialHandler; + + +/***/ }), + +/***/ 4551: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PersonalAccessTokenCredentialHandler = void 0; +const resthandlers = __nccwpck_require__(4442); +class PersonalAccessTokenCredentialHandler extends resthandlers.PersonalAccessTokenCredentialHandler { + constructor(token, allowCrossOriginAuthentication = true) { + super(token, allowCrossOriginAuthentication); + } +} +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + + +/***/ }), + +/***/ 6228: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.ValidationResult = exports.State = exports.Severity = exports.SarifJobStatus = exports.ResultType = exports.MetadataOperation = exports.MetadataChangeType = exports.LicenseState = exports.ExpandOption = exports.DismissalType = exports.DependencyKind = exports.Confidence = exports.ComponentType = exports.AnalysisConfigurationType = exports.AlertValidityStatus = exports.AlertValidationRequestStatus = exports.AlertType = exports.AlertListExpandOption = void 0; +var AlertListExpandOption; +(function (AlertListExpandOption) { + /** + * No Expands. + */ + AlertListExpandOption[AlertListExpandOption["None"] = 0] = "None"; + /** + * Return a minimal representation of an alert. + */ + AlertListExpandOption[AlertListExpandOption["Minimal"] = 1] = "Minimal"; +})(AlertListExpandOption = exports.AlertListExpandOption || (exports.AlertListExpandOption = {})); +var AlertType; +(function (AlertType) { + /** + * The code has an unspecified vulnerability type + */ + AlertType[AlertType["Unknown"] = 0] = "Unknown"; + /** + * The code uses a dependency with a known vulnerability. + */ + AlertType[AlertType["Dependency"] = 1] = "Dependency"; + /** + * The code contains a secret that has now been compromised and must be revoked. + */ + AlertType[AlertType["Secret"] = 2] = "Secret"; + /** + * The code contains a weakness determined by static analysis. + */ + AlertType[AlertType["Code"] = 3] = "Code"; + /** + * The code uses a dependency with potential license incompliance. + */ + AlertType[AlertType["License"] = 4] = "License"; +})(AlertType = exports.AlertType || (exports.AlertType = {})); +var AlertValidationRequestStatus; +(function (AlertValidationRequestStatus) { + /** + * Default, when the request status is not set/applicable. + */ + AlertValidationRequestStatus[AlertValidationRequestStatus["None"] = 0] = "None"; + /** + * First validation request for the alert's validation fingerprints, created when the sarif is submitted for processing. + */ + AlertValidationRequestStatus[AlertValidationRequestStatus["Created"] = 1] = "Created"; + /** + * The secret validation jobs for the alert's validation fingerprints have been manually queued and at least one is still in progress. + */ + AlertValidationRequestStatus[AlertValidationRequestStatus["InProgress"] = 2] = "InProgress"; + /** + * All the secret validation jobs for the alert's validation fingerprints have returned Completed or Failed. + */ + AlertValidationRequestStatus[AlertValidationRequestStatus["Completed"] = 3] = "Completed"; + /** + * This status is set only when there is an exception in the ValidationService. + */ + AlertValidationRequestStatus[AlertValidationRequestStatus["Failed"] = 4] = "Failed"; +})(AlertValidationRequestStatus = exports.AlertValidationRequestStatus || (exports.AlertValidationRequestStatus = {})); +var AlertValidityStatus; +(function (AlertValidityStatus) { + /** + * When there are no validation fingerprints attached to the alert. + */ + AlertValidityStatus[AlertValidityStatus["None"] = 0] = "None"; + /** + * When the validations for validation fingerprints associated to the alert have not been conclusive. + */ + AlertValidityStatus[AlertValidityStatus["Unknown"] = 1] = "Unknown"; + /** + * When atleast one validation fingerprint associated to the alert is exploitable. + */ + AlertValidityStatus[AlertValidityStatus["Active"] = 2] = "Active"; + /** + * When all validation fingerprints associated to the alert are not exploitable. + */ + AlertValidityStatus[AlertValidityStatus["Inactive"] = 3] = "Inactive"; +})(AlertValidityStatus = exports.AlertValidityStatus || (exports.AlertValidityStatus = {})); +var AnalysisConfigurationType; +(function (AnalysisConfigurationType) { + /** + * Default analysis configuration that is not attached to any other configuration data + */ + AnalysisConfigurationType[AnalysisConfigurationType["Default"] = 0] = "Default"; + /** + * Ado Pipeline, contains branch, pipeline, phase, and ADOPipelineId + */ + AnalysisConfigurationType[AnalysisConfigurationType["AdoPipeline"] = 1] = "AdoPipeline"; +})(AnalysisConfigurationType = exports.AnalysisConfigurationType || (exports.AnalysisConfigurationType = {})); +/** + * This enum defines the dependency components. + */ +var ComponentType; +(function (ComponentType) { + ComponentType[ComponentType["Unknown"] = 0] = "Unknown"; + ComponentType[ComponentType["NuGet"] = 1] = "NuGet"; + /** + * Indicates the component is an Npm package. + */ + ComponentType[ComponentType["Npm"] = 2] = "Npm"; + /** + * Indicates the component is a Maven artifact. + */ + ComponentType[ComponentType["Maven"] = 3] = "Maven"; + /** + * Indicates the component is a Git repository. + */ + ComponentType[ComponentType["Git"] = 4] = "Git"; + /** + * Indicates the component is not any of the supported component types by Governance. + */ + ComponentType[ComponentType["Other"] = 5] = "Other"; + /** + * Indicates the component is a Ruby gem. + */ + ComponentType[ComponentType["RubyGems"] = 6] = "RubyGems"; + /** + * Indicates the component is a Cargo package. + */ + ComponentType[ComponentType["Cargo"] = 7] = "Cargo"; + /** + * Indicates the component is a Pip package. + */ + ComponentType[ComponentType["Pip"] = 8] = "Pip"; + /** + * Indicates the component is a loose file. Not a package as understood by different package managers. + */ + ComponentType[ComponentType["File"] = 9] = "File"; + /** + * Indicates the component is a Go package. + */ + ComponentType[ComponentType["Go"] = 10] = "Go"; + /** + * Indicates the component is a Docker Image + */ + ComponentType[ComponentType["DockerImage"] = 11] = "DockerImage"; + /** + * Indicates the component is a CocoaPods pod. + */ + ComponentType[ComponentType["Pod"] = 12] = "Pod"; + /** + * Indicates the component is found in a linux environment. A package understood by linux based package managers like apt and rpm. + */ + ComponentType[ComponentType["Linux"] = 13] = "Linux"; + /** + * Indicates the component is a Conda package. + */ + ComponentType[ComponentType["Conda"] = 14] = "Conda"; + /** + * Indicates the component is a Docker Reference. + */ + ComponentType[ComponentType["DockerReference"] = 15] = "DockerReference"; + /** + * Indicates the component is a Vcpkg Package. + */ + ComponentType[ComponentType["Vcpkg"] = 16] = "Vcpkg"; +})(ComponentType = exports.ComponentType || (exports.ComponentType = {})); +var Confidence; +(function (Confidence) { + /** + * High confidence level for alert + */ + Confidence[Confidence["High"] = 0] = "High"; + /** + * Other confidence level for alert + */ + Confidence[Confidence["Other"] = 1] = "Other"; +})(Confidence = exports.Confidence || (exports.Confidence = {})); +var DependencyKind; +(function (DependencyKind) { + DependencyKind[DependencyKind["Unknown"] = 0] = "Unknown"; + /** + * The root dependency introduced the component being alerted. + */ + DependencyKind[DependencyKind["RootDependency"] = 1] = "RootDependency"; + /** + * The component being alerted. + */ + DependencyKind[DependencyKind["Component"] = 2] = "Component"; + /** + * Vulnerable Dependency. Deprecating this value. Use Component instead. + */ + DependencyKind[DependencyKind["VulnerableDependency"] = 3] = "VulnerableDependency"; +})(DependencyKind = exports.DependencyKind || (exports.DependencyKind = {})); +var DismissalType; +(function (DismissalType) { + /** + * Dismissal type unknown + */ + DismissalType[DismissalType["Unknown"] = 0] = "Unknown"; + /** + * Dismissal indicating alert has been fixed + */ + DismissalType[DismissalType["Fixed"] = 1] = "Fixed"; + /** + * Dismissal indicating user is accepting a risk for the alert + */ + DismissalType[DismissalType["AcceptedRisk"] = 2] = "AcceptedRisk"; + /** + * Dismissal indicating alert is a false positive and will likely not be fixed. + */ + DismissalType[DismissalType["FalsePositive"] = 3] = "FalsePositive"; + /** + * Dismissal indicating user is agreeing to follow license guidance. + */ + DismissalType[DismissalType["AgreedToGuidance"] = 4] = "AgreedToGuidance"; + /** + * Dismissal indicating backend detection tool was upgraded and the alert is not detected by the new version of tool. + */ + DismissalType[DismissalType["ToolUpgrade"] = 5] = "ToolUpgrade"; +})(DismissalType = exports.DismissalType || (exports.DismissalType = {})); +var ExpandOption; +(function (ExpandOption) { + /** + * No Expands. + */ + ExpandOption[ExpandOption["None"] = 0] = "None"; + /** + * Return validationFingerprints in Alert. + */ + ExpandOption[ExpandOption["ValidationFingerprint"] = 1] = "ValidationFingerprint"; +})(ExpandOption = exports.ExpandOption || (exports.ExpandOption = {})); +var LicenseState; +(function (LicenseState) { + /** + * Information of the license has not been harvested by ClearlyDefined + */ + LicenseState[LicenseState["Unknown"] = 0] = "Unknown"; + /** + * Information of the license has not been harvested by ClearlyDefined + */ + LicenseState[LicenseState["NotHarvested"] = 1] = "NotHarvested"; + /** + * Information of the license has been harvested by ClearlyDefined + */ + LicenseState[LicenseState["Harvested"] = 2] = "Harvested"; +})(LicenseState = exports.LicenseState || (exports.LicenseState = {})); +/** + * The type of change that occurred to the metadata. + */ +var MetadataChangeType; +(function (MetadataChangeType) { + MetadataChangeType[MetadataChangeType["None"] = 0] = "None"; + MetadataChangeType[MetadataChangeType["Created"] = 1] = "Created"; + MetadataChangeType[MetadataChangeType["Updated"] = 2] = "Updated"; + MetadataChangeType[MetadataChangeType["Deleted"] = 3] = "Deleted"; +})(MetadataChangeType = exports.MetadataChangeType || (exports.MetadataChangeType = {})); +/** + * The operation to be performed on the metadata. + */ +var MetadataOperation; +(function (MetadataOperation) { + /** + * Represents the defualt value if the operation is not specified or not supported. + */ + MetadataOperation[MetadataOperation["None"] = 0] = "None"; + /** + * Represents the addition of the metadata. + */ + MetadataOperation[MetadataOperation["Add"] = 1] = "Add"; + /** + * Represents the removal of the metadata. + */ + MetadataOperation[MetadataOperation["Remove"] = 2] = "Remove"; +})(MetadataOperation = exports.MetadataOperation || (exports.MetadataOperation = {})); +/** + * This enum defines the different result types. + */ +var ResultType; +(function (ResultType) { + /** + * The result was found from an unspecified analysis type + */ + ResultType[ResultType["Unknown"] = 0] = "Unknown"; + /** + * The result was found from dependency analysis + */ + ResultType[ResultType["Dependency"] = 1] = "Dependency"; + /** + * The result was found from static code analysis + */ + ResultType[ResultType["VersionControl"] = 2] = "VersionControl"; +})(ResultType = exports.ResultType || (exports.ResultType = {})); +var SarifJobStatus; +(function (SarifJobStatus) { + /** + * The job type when it is new + */ + SarifJobStatus[SarifJobStatus["New"] = 0] = "New"; + /** + * The job type when it is queued + */ + SarifJobStatus[SarifJobStatus["Queued"] = 1] = "Queued"; + /** + * The job type when it is completed + */ + SarifJobStatus[SarifJobStatus["Completed"] = 2] = "Completed"; + /** + * The job type when it fails + */ + SarifJobStatus[SarifJobStatus["Failed"] = 3] = "Failed"; + /** + * The job type when it is queued on exception + */ + SarifJobStatus[SarifJobStatus["Requeued"] = 4] = "Requeued"; +})(SarifJobStatus = exports.SarifJobStatus || (exports.SarifJobStatus = {})); +var Severity; +(function (Severity) { + Severity[Severity["Low"] = 0] = "Low"; + Severity[Severity["Medium"] = 1] = "Medium"; + Severity[Severity["High"] = 2] = "High"; + Severity[Severity["Critical"] = 3] = "Critical"; + Severity[Severity["Note"] = 4] = "Note"; + Severity[Severity["Warning"] = 5] = "Warning"; + Severity[Severity["Error"] = 6] = "Error"; + Severity[Severity["Undefined"] = 7] = "Undefined"; +})(Severity = exports.Severity || (exports.Severity = {})); +var State; +(function (State) { + /** + * Alert is in an indeterminate state + */ + State[State["Unknown"] = 0] = "Unknown"; + /** + * Alert has been detected in the code + */ + State[State["Active"] = 1] = "Active"; + /** + * Alert was dismissed by a user + */ + State[State["Dismissed"] = 2] = "Dismissed"; + /** + * The issue is no longer detected in the code + */ + State[State["Fixed"] = 4] = "Fixed"; + /** + * The tool has determined that the issue is no longer a risk + */ + State[State["AutoDismissed"] = 8] = "AutoDismissed"; +})(State = exports.State || (exports.State = {})); +var ValidationResult; +(function (ValidationResult) { + /** + * Default value, no information about the secret can be inferred from this. + */ + ValidationResult[ValidationResult["None"] = 0] = "None"; + /** + * Represents a secret that can be used to connect to a resource. + */ + ValidationResult[ValidationResult["Exploitable"] = 1] = "Exploitable"; + /** + * Represents a secret that can't be used to connect to a resource. + */ + ValidationResult[ValidationResult["NotExploitable"] = 2] = "NotExploitable"; + /** + * Represents a secret where no determination can be made about its exploitability. + */ + ValidationResult[ValidationResult["Inconclusive"] = 3] = "Inconclusive"; +})(ValidationResult = exports.ValidationResult || (exports.ValidationResult = {})); +exports.TypeInfo = { + Alert: {}, + AlertAnalysisInstance: {}, + AlertListExpandOption: { + enumValues: { + "none": 0, + "minimal": 1 + } + }, + AlertMetadata: {}, + AlertMetadataChange: {}, + AlertStateUpdate: {}, + AlertType: { + enumValues: { + "unknown": 0, + "dependency": 1, + "secret": 2, + "code": 3, + "license": 4 + } + }, + AlertValidationRequestStatus: { + enumValues: { + "none": 0, + "created": 1, + "inProgress": 2, + "completed": 3, + "failed": 4 + } + }, + AlertValidityInfo: {}, + AlertValidityStatus: { + enumValues: { + "none": 0, + "unknown": 1, + "active": 2, + "inactive": 3 + } + }, + AnalysisConfiguration: {}, + AnalysisConfigurationType: { + enumValues: { + "default": 0, + "adoPipeline": 1 + } + }, + AnalysisInstance: {}, + AnalysisResult: {}, + Branch: {}, + ComponentType: { + enumValues: { + "unknown": 0, + "nuGet": 1, + "npm": 2, + "maven": 3, + "git": 4, + "other": 5, + "rubyGems": 6, + "cargo": 7, + "pip": 8, + "file": 9, + "go": 10, + "dockerImage": 11, + "pod": 12, + "linux": 13, + "conda": 14, + "dockerReference": 15, + "vcpkg": 16 + } + }, + Confidence: { + enumValues: { + "high": 0, + "other": 1 + } + }, + Dependency: {}, + DependencyKind: { + enumValues: { + "unknown": 0, + "rootDependency": 1, + "component": 2, + "vulnerableDependency": 3 + } + }, + DependencyResult: {}, + Dismissal: {}, + DismissalType: { + enumValues: { + "unknown": 0, + "fixed": 1, + "acceptedRisk": 2, + "falsePositive": 3, + "agreedToGuidance": 4, + "toolUpgrade": 5 + } + }, + ExpandOption: { + enumValues: { + "none": 0, + "validationFingerprint": 1 + } + }, + License: {}, + LicenseState: { + enumValues: { + "unknown": 0, + "notHarvested": 1, + "harvested": 2 + } + }, + LogicalLocation: {}, + Metadata: {}, + MetadataChange: {}, + MetadataChangeType: { + enumValues: { + "none": 0, + "created": 1, + "updated": 2, + "deleted": 3 + } + }, + MetadataOperation: { + enumValues: { + "none": 0, + "add": 1, + "remove": 2 + } + }, + Result: {}, + ResultType: { + enumValues: { + "unknown": 0, + "dependency": 1, + "versionControl": 2 + } + }, + SarifJobStatus: { + enumValues: { + "new": 0, + "queued": 1, + "completed": 2, + "failed": 3, + "requeued": 4 + } + }, + SarifUploadStatus: {}, + SearchCriteria: {}, + Severity: { + enumValues: { + "low": 0, + "medium": 1, + "high": 2, + "critical": 3, + "note": 4, + "warning": 5, + "error": 6, + "undefined": 7 + } + }, + State: { + enumValues: { + "unknown": 0, + "active": 1, + "dismissed": 2, + "fixed": 4, + "autoDismissed": 8 + } + }, + UxFilters: {}, + ValidationFingerprint: {}, + ValidationRequestInfo: {}, + ValidationResult: { + enumValues: { + "none": 0, + "exploitable": 1, + "notExploitable": 2, + "inconclusive": 3 + } + }, +}; +exports.TypeInfo.Alert.fields = { + alertType: { + enumType: exports.TypeInfo.AlertType + }, + confidence: { + enumType: exports.TypeInfo.Confidence + }, + dismissal: { + typeInfo: exports.TypeInfo.Dismissal + }, + firstSeenDate: { + isDate: true, + }, + fixedDate: { + isDate: true, + }, + introducedDate: { + isDate: true, + }, + lastSeenDate: { + isDate: true, + }, + logicalLocations: { + isArray: true, + typeInfo: exports.TypeInfo.LogicalLocation + }, + severity: { + enumType: exports.TypeInfo.Severity + }, + state: { + enumType: exports.TypeInfo.State + }, + validationFingerprints: { + isArray: true, + typeInfo: exports.TypeInfo.ValidationFingerprint + }, + validityDetails: { + typeInfo: exports.TypeInfo.AlertValidityInfo + } +}; +exports.TypeInfo.AlertAnalysisInstance.fields = { + analysisConfiguration: { + typeInfo: exports.TypeInfo.AnalysisConfiguration + }, + firstSeen: { + typeInfo: exports.TypeInfo.AnalysisInstance + }, + fixedIn: { + typeInfo: exports.TypeInfo.AnalysisInstance + }, + lastSeen: { + typeInfo: exports.TypeInfo.AnalysisInstance + }, + recentAnalysisInstance: { + typeInfo: exports.TypeInfo.AnalysisInstance + }, + state: { + enumType: exports.TypeInfo.State + } +}; +exports.TypeInfo.AlertMetadata.fields = { + metadata: { + isArray: true, + typeInfo: exports.TypeInfo.Metadata + } +}; +exports.TypeInfo.AlertMetadataChange.fields = { + metadataChange: { + typeInfo: exports.TypeInfo.MetadataChange + } +}; +exports.TypeInfo.AlertStateUpdate.fields = { + dismissedReason: { + enumType: exports.TypeInfo.DismissalType + }, + state: { + enumType: exports.TypeInfo.State + } +}; +exports.TypeInfo.AlertValidityInfo.fields = { + validityLastCheckedDate: { + isDate: true, + }, + validityStatus: { + enumType: exports.TypeInfo.AlertValidityStatus + } +}; +exports.TypeInfo.AnalysisConfiguration.fields = { + alertType: { + enumType: exports.TypeInfo.AlertType + }, + analysisConfigurationType: { + enumType: exports.TypeInfo.AnalysisConfigurationType + } +}; +exports.TypeInfo.AnalysisInstance.fields = { + configuration: { + typeInfo: exports.TypeInfo.AnalysisConfiguration + }, + createdDate: { + isDate: true, + }, + results: { + isArray: true, + typeInfo: exports.TypeInfo.AnalysisResult + } +}; +exports.TypeInfo.AnalysisResult.fields = { + result: { + typeInfo: exports.TypeInfo.Result + }, + state: { + enumType: exports.TypeInfo.State + } +}; +exports.TypeInfo.Branch.fields = { + deletedDate: { + isDate: true, + } +}; +exports.TypeInfo.Dependency.fields = { + componentType: { + enumType: exports.TypeInfo.ComponentType + }, + license: { + typeInfo: exports.TypeInfo.License + } +}; +exports.TypeInfo.DependencyResult.fields = { + dependency: { + typeInfo: exports.TypeInfo.Dependency + } +}; +exports.TypeInfo.Dismissal.fields = { + dismissalType: { + enumType: exports.TypeInfo.DismissalType + }, + requestedOn: { + isDate: true, + } +}; +exports.TypeInfo.License.fields = { + state: { + enumType: exports.TypeInfo.LicenseState + } +}; +exports.TypeInfo.LogicalLocation.fields = { + kind: { + enumType: exports.TypeInfo.DependencyKind + }, + license: { + typeInfo: exports.TypeInfo.License + } +}; +exports.TypeInfo.Metadata.fields = { + op: { + enumType: exports.TypeInfo.MetadataOperation + } +}; +exports.TypeInfo.MetadataChange.fields = { + changeType: { + enumType: exports.TypeInfo.MetadataChangeType + } +}; +exports.TypeInfo.Result.fields = { + dependencyResult: { + typeInfo: exports.TypeInfo.DependencyResult + }, + resultType: { + enumType: exports.TypeInfo.ResultType + }, + severity: { + enumType: exports.TypeInfo.Severity + } +}; +exports.TypeInfo.SarifUploadStatus.fields = { + processingStatus: { + enumType: exports.TypeInfo.SarifJobStatus + } +}; +exports.TypeInfo.SearchCriteria.fields = { + alertType: { + enumType: exports.TypeInfo.AlertType + }, + confidenceLevels: { + isArray: true, + enumType: exports.TypeInfo.Confidence + }, + fromDate: { + isDate: true, + }, + modifiedSince: { + isDate: true, + }, + severities: { + isArray: true, + enumType: exports.TypeInfo.Severity + }, + states: { + isArray: true, + enumType: exports.TypeInfo.State + }, + toDate: { + isDate: true, + }, + validity: { + isArray: true, + enumType: exports.TypeInfo.AlertValidityStatus + } +}; +exports.TypeInfo.UxFilters.fields = { + branches: { + isArray: true, + typeInfo: exports.TypeInfo.Branch + }, + confidenceLevels: { + isArray: true, + enumType: exports.TypeInfo.Confidence + }, + licenses: { + isArray: true, + typeInfo: exports.TypeInfo.License + }, + packages: { + isArray: true, + typeInfo: exports.TypeInfo.Dependency + }, + severities: { + isArray: true, + enumType: exports.TypeInfo.Severity + }, + states: { + isArray: true, + enumType: exports.TypeInfo.State + }, + validity: { + isArray: true, + enumType: exports.TypeInfo.AlertValidityStatus + } +}; +exports.TypeInfo.ValidationFingerprint.fields = { + validityLastUpdatedDate: { + isDate: true, + }, + validityResult: { + enumType: exports.TypeInfo.ValidationResult + } +}; +exports.TypeInfo.ValidationRequestInfo.fields = { + alertValidationRequestStatus: { + enumType: exports.TypeInfo.AlertValidationRequestStatus + }, + validityLastCheckedDate: { + isDate: true, + }, + validityStatus: { + enumType: exports.TypeInfo.AlertValidityStatus + } +}; + + +/***/ }), + +/***/ 2167: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.WorkspaceMappingType = exports.ValidationResult = exports.TimelineRecordState = exports.TaskResult = exports.SupportLevel = exports.StageUpdateType = exports.SourceProviderAvailability = exports.ServiceHostStatus = exports.ScheduleDays = exports.ResultSet = exports.RepositoryCleanOptions = exports.QueuePriority = exports.QueueOptions = exports.QueryDeletedOption = exports.ProcessTemplateType = exports.IssueType = exports.GetOption = exports.FolderQueryOrder = exports.DeleteOptions = exports.DefinitionType = exports.DefinitionTriggerType = exports.DefinitionQueueStatus = exports.DefinitionQueryOrder = exports.DefinitionQuality = exports.ControllerStatus = exports.BuildStatus = exports.BuildResult = exports.BuildReason = exports.BuildQueryOrder = exports.BuildPhaseStatus = exports.BuildOptionInputType = exports.BuildAuthorizationScope = exports.AuditAction = exports.AgentStatus = void 0; +const TFS_TestManagement_Contracts = __nccwpck_require__(3047); +const TfsCoreInterfaces = __nccwpck_require__(3931); +var AgentStatus; +(function (AgentStatus) { + /** + * Indicates that the build agent cannot be contacted. + */ + AgentStatus[AgentStatus["Unavailable"] = 0] = "Unavailable"; + /** + * Indicates that the build agent is currently available. + */ + AgentStatus[AgentStatus["Available"] = 1] = "Available"; + /** + * Indicates that the build agent has taken itself offline. + */ + AgentStatus[AgentStatus["Offline"] = 2] = "Offline"; +})(AgentStatus = exports.AgentStatus || (exports.AgentStatus = {})); +var AuditAction; +(function (AuditAction) { + AuditAction[AuditAction["Add"] = 1] = "Add"; + AuditAction[AuditAction["Update"] = 2] = "Update"; + AuditAction[AuditAction["Delete"] = 3] = "Delete"; +})(AuditAction = exports.AuditAction || (exports.AuditAction = {})); +/** + * Represents the desired scope of authorization for a build. + */ +var BuildAuthorizationScope; +(function (BuildAuthorizationScope) { + /** + * The identity used should have build service account permissions scoped to the project collection. This is useful when resources for a single build are spread across multiple projects. + */ + BuildAuthorizationScope[BuildAuthorizationScope["ProjectCollection"] = 1] = "ProjectCollection"; + /** + * The identity used should have build service account permissions scoped to the project in which the build definition resides. This is useful for isolation of build jobs to a particular team project to avoid any unintentional escalation of privilege attacks during a build. + */ + BuildAuthorizationScope[BuildAuthorizationScope["Project"] = 2] = "Project"; +})(BuildAuthorizationScope = exports.BuildAuthorizationScope || (exports.BuildAuthorizationScope = {})); +var BuildOptionInputType; +(function (BuildOptionInputType) { + BuildOptionInputType[BuildOptionInputType["String"] = 0] = "String"; + BuildOptionInputType[BuildOptionInputType["Boolean"] = 1] = "Boolean"; + BuildOptionInputType[BuildOptionInputType["StringList"] = 2] = "StringList"; + BuildOptionInputType[BuildOptionInputType["Radio"] = 3] = "Radio"; + BuildOptionInputType[BuildOptionInputType["PickList"] = 4] = "PickList"; + BuildOptionInputType[BuildOptionInputType["MultiLine"] = 5] = "MultiLine"; + BuildOptionInputType[BuildOptionInputType["BranchFilter"] = 6] = "BranchFilter"; +})(BuildOptionInputType = exports.BuildOptionInputType || (exports.BuildOptionInputType = {})); +var BuildPhaseStatus; +(function (BuildPhaseStatus) { + /** + * The state is not known. + */ + BuildPhaseStatus[BuildPhaseStatus["Unknown"] = 0] = "Unknown"; + /** + * The build phase completed unsuccessfully. + */ + BuildPhaseStatus[BuildPhaseStatus["Failed"] = 1] = "Failed"; + /** + * The build phase completed successfully. + */ + BuildPhaseStatus[BuildPhaseStatus["Succeeded"] = 2] = "Succeeded"; +})(BuildPhaseStatus = exports.BuildPhaseStatus || (exports.BuildPhaseStatus = {})); +/** + * Specifies the desired ordering of builds. + */ +var BuildQueryOrder; +(function (BuildQueryOrder) { + /** + * Order by finish time ascending. + */ + BuildQueryOrder[BuildQueryOrder["FinishTimeAscending"] = 2] = "FinishTimeAscending"; + /** + * Order by finish time descending. + */ + BuildQueryOrder[BuildQueryOrder["FinishTimeDescending"] = 3] = "FinishTimeDescending"; + /** + * Order by queue time descending. + */ + BuildQueryOrder[BuildQueryOrder["QueueTimeDescending"] = 4] = "QueueTimeDescending"; + /** + * Order by queue time ascending. + */ + BuildQueryOrder[BuildQueryOrder["QueueTimeAscending"] = 5] = "QueueTimeAscending"; + /** + * Order by start time descending. + */ + BuildQueryOrder[BuildQueryOrder["StartTimeDescending"] = 6] = "StartTimeDescending"; + /** + * Order by start time ascending. + */ + BuildQueryOrder[BuildQueryOrder["StartTimeAscending"] = 7] = "StartTimeAscending"; +})(BuildQueryOrder = exports.BuildQueryOrder || (exports.BuildQueryOrder = {})); +var BuildReason; +(function (BuildReason) { + /** + * No reason. This value should not be used. + */ + BuildReason[BuildReason["None"] = 0] = "None"; + /** + * The build was started manually. + */ + BuildReason[BuildReason["Manual"] = 1] = "Manual"; + /** + * The build was started for the trigger TriggerType.ContinuousIntegration. + */ + BuildReason[BuildReason["IndividualCI"] = 2] = "IndividualCI"; + /** + * The build was started for the trigger TriggerType.BatchedContinuousIntegration. + */ + BuildReason[BuildReason["BatchedCI"] = 4] = "BatchedCI"; + /** + * The build was started for the trigger TriggerType.Schedule. + */ + BuildReason[BuildReason["Schedule"] = 8] = "Schedule"; + /** + * The build was started for the trigger TriggerType.ScheduleForced. + */ + BuildReason[BuildReason["ScheduleForced"] = 16] = "ScheduleForced"; + /** + * The build was created by a user. + */ + BuildReason[BuildReason["UserCreated"] = 32] = "UserCreated"; + /** + * The build was started manually for private validation. + */ + BuildReason[BuildReason["ValidateShelveset"] = 64] = "ValidateShelveset"; + /** + * The build was started for the trigger ContinuousIntegrationType.Gated. + */ + BuildReason[BuildReason["CheckInShelveset"] = 128] = "CheckInShelveset"; + /** + * The build was started by a pull request. Added in resource version 3. + */ + BuildReason[BuildReason["PullRequest"] = 256] = "PullRequest"; + /** + * The build was started when another build completed. + */ + BuildReason[BuildReason["BuildCompletion"] = 512] = "BuildCompletion"; + /** + * The build was started when resources in pipeline triggered it + */ + BuildReason[BuildReason["ResourceTrigger"] = 1024] = "ResourceTrigger"; + /** + * The build was triggered for retention policy purposes. + */ + BuildReason[BuildReason["Triggered"] = 1967] = "Triggered"; + /** + * All reasons. + */ + BuildReason[BuildReason["All"] = 2031] = "All"; +})(BuildReason = exports.BuildReason || (exports.BuildReason = {})); +/** + * This is not a Flags enum because we don't want to set multiple statuses on a build. However, when adding values, please stick to powers of 2 as if it were a Flags enum This will ensure that things that key off multiple result types (like labelling sources) continue to work + */ +var BuildResult; +(function (BuildResult) { + /** + * No result + */ + BuildResult[BuildResult["None"] = 0] = "None"; + /** + * The build completed successfully. + */ + BuildResult[BuildResult["Succeeded"] = 2] = "Succeeded"; + /** + * The build completed compilation successfully but had other errors. + */ + BuildResult[BuildResult["PartiallySucceeded"] = 4] = "PartiallySucceeded"; + /** + * The build completed unsuccessfully. + */ + BuildResult[BuildResult["Failed"] = 8] = "Failed"; + /** + * The build was canceled before starting. + */ + BuildResult[BuildResult["Canceled"] = 32] = "Canceled"; +})(BuildResult = exports.BuildResult || (exports.BuildResult = {})); +var BuildStatus; +(function (BuildStatus) { + /** + * No status. + */ + BuildStatus[BuildStatus["None"] = 0] = "None"; + /** + * The build is currently in progress. + */ + BuildStatus[BuildStatus["InProgress"] = 1] = "InProgress"; + /** + * The build has completed. + */ + BuildStatus[BuildStatus["Completed"] = 2] = "Completed"; + /** + * The build is cancelling + */ + BuildStatus[BuildStatus["Cancelling"] = 4] = "Cancelling"; + /** + * The build is inactive in the queue. + */ + BuildStatus[BuildStatus["Postponed"] = 8] = "Postponed"; + /** + * The build has not yet started. + */ + BuildStatus[BuildStatus["NotStarted"] = 32] = "NotStarted"; + /** + * All status. + */ + BuildStatus[BuildStatus["All"] = 47] = "All"; +})(BuildStatus = exports.BuildStatus || (exports.BuildStatus = {})); +var ControllerStatus; +(function (ControllerStatus) { + /** + * Indicates that the build controller cannot be contacted. + */ + ControllerStatus[ControllerStatus["Unavailable"] = 0] = "Unavailable"; + /** + * Indicates that the build controller is currently available. + */ + ControllerStatus[ControllerStatus["Available"] = 1] = "Available"; + /** + * Indicates that the build controller has taken itself offline. + */ + ControllerStatus[ControllerStatus["Offline"] = 2] = "Offline"; +})(ControllerStatus = exports.ControllerStatus || (exports.ControllerStatus = {})); +var DefinitionQuality; +(function (DefinitionQuality) { + DefinitionQuality[DefinitionQuality["Definition"] = 1] = "Definition"; + DefinitionQuality[DefinitionQuality["Draft"] = 2] = "Draft"; +})(DefinitionQuality = exports.DefinitionQuality || (exports.DefinitionQuality = {})); +/** + * Specifies the desired ordering of definitions. + */ +var DefinitionQueryOrder; +(function (DefinitionQueryOrder) { + /** + * No order + */ + DefinitionQueryOrder[DefinitionQueryOrder["None"] = 0] = "None"; + /** + * Order by created on/last modified time ascending. + */ + DefinitionQueryOrder[DefinitionQueryOrder["LastModifiedAscending"] = 1] = "LastModifiedAscending"; + /** + * Order by created on/last modified time descending. + */ + DefinitionQueryOrder[DefinitionQueryOrder["LastModifiedDescending"] = 2] = "LastModifiedDescending"; + /** + * Order by definition name ascending. + */ + DefinitionQueryOrder[DefinitionQueryOrder["DefinitionNameAscending"] = 3] = "DefinitionNameAscending"; + /** + * Order by definition name descending. + */ + DefinitionQueryOrder[DefinitionQueryOrder["DefinitionNameDescending"] = 4] = "DefinitionNameDescending"; +})(DefinitionQueryOrder = exports.DefinitionQueryOrder || (exports.DefinitionQueryOrder = {})); +var DefinitionQueueStatus; +(function (DefinitionQueueStatus) { + /** + * When enabled the definition queue allows builds to be queued by users, the system will queue scheduled, gated and continuous integration builds, and the queued builds will be started by the system. + */ + DefinitionQueueStatus[DefinitionQueueStatus["Enabled"] = 0] = "Enabled"; + /** + * When paused the definition queue allows builds to be queued by users and the system will queue scheduled, gated and continuous integration builds. Builds in the queue will not be started by the system. + */ + DefinitionQueueStatus[DefinitionQueueStatus["Paused"] = 1] = "Paused"; + /** + * When disabled the definition queue will not allow builds to be queued by users and the system will not queue scheduled, gated or continuous integration builds. Builds already in the queue will not be started by the system. + */ + DefinitionQueueStatus[DefinitionQueueStatus["Disabled"] = 2] = "Disabled"; +})(DefinitionQueueStatus = exports.DefinitionQueueStatus || (exports.DefinitionQueueStatus = {})); +var DefinitionTriggerType; +(function (DefinitionTriggerType) { + /** + * Manual builds only. + */ + DefinitionTriggerType[DefinitionTriggerType["None"] = 1] = "None"; + /** + * A build should be started for each changeset. + */ + DefinitionTriggerType[DefinitionTriggerType["ContinuousIntegration"] = 2] = "ContinuousIntegration"; + /** + * A build should be started for multiple changesets at a time at a specified interval. + */ + DefinitionTriggerType[DefinitionTriggerType["BatchedContinuousIntegration"] = 4] = "BatchedContinuousIntegration"; + /** + * A build should be started on a specified schedule whether or not changesets exist. + */ + DefinitionTriggerType[DefinitionTriggerType["Schedule"] = 8] = "Schedule"; + /** + * A validation build should be started for each check-in. + */ + DefinitionTriggerType[DefinitionTriggerType["GatedCheckIn"] = 16] = "GatedCheckIn"; + /** + * A validation build should be started for each batch of check-ins. + */ + DefinitionTriggerType[DefinitionTriggerType["BatchedGatedCheckIn"] = 32] = "BatchedGatedCheckIn"; + /** + * A build should be triggered when a GitHub pull request is created or updated. Added in resource version 3 + */ + DefinitionTriggerType[DefinitionTriggerType["PullRequest"] = 64] = "PullRequest"; + /** + * A build should be triggered when another build completes. + */ + DefinitionTriggerType[DefinitionTriggerType["BuildCompletion"] = 128] = "BuildCompletion"; + /** + * All types. + */ + DefinitionTriggerType[DefinitionTriggerType["All"] = 255] = "All"; +})(DefinitionTriggerType = exports.DefinitionTriggerType || (exports.DefinitionTriggerType = {})); +var DefinitionType; +(function (DefinitionType) { + DefinitionType[DefinitionType["Xaml"] = 1] = "Xaml"; + DefinitionType[DefinitionType["Build"] = 2] = "Build"; +})(DefinitionType = exports.DefinitionType || (exports.DefinitionType = {})); +var DeleteOptions; +(function (DeleteOptions) { + /** + * No data should be deleted. This value should not be used. + */ + DeleteOptions[DeleteOptions["None"] = 0] = "None"; + /** + * The drop location should be deleted. + */ + DeleteOptions[DeleteOptions["DropLocation"] = 1] = "DropLocation"; + /** + * The test results should be deleted. + */ + DeleteOptions[DeleteOptions["TestResults"] = 2] = "TestResults"; + /** + * The version control label should be deleted. + */ + DeleteOptions[DeleteOptions["Label"] = 4] = "Label"; + /** + * The build should be deleted. + */ + DeleteOptions[DeleteOptions["Details"] = 8] = "Details"; + /** + * Published symbols should be deleted. + */ + DeleteOptions[DeleteOptions["Symbols"] = 16] = "Symbols"; + /** + * All data should be deleted. + */ + DeleteOptions[DeleteOptions["All"] = 31] = "All"; +})(DeleteOptions = exports.DeleteOptions || (exports.DeleteOptions = {})); +/** + * Specifies the desired ordering of folders. + */ +var FolderQueryOrder; +(function (FolderQueryOrder) { + /** + * No order + */ + FolderQueryOrder[FolderQueryOrder["None"] = 0] = "None"; + /** + * Order by folder name and path ascending. + */ + FolderQueryOrder[FolderQueryOrder["FolderAscending"] = 1] = "FolderAscending"; + /** + * Order by folder name and path descending. + */ + FolderQueryOrder[FolderQueryOrder["FolderDescending"] = 2] = "FolderDescending"; +})(FolderQueryOrder = exports.FolderQueryOrder || (exports.FolderQueryOrder = {})); +var GetOption; +(function (GetOption) { + /** + * Use the latest changeset at the time the build is queued. + */ + GetOption[GetOption["LatestOnQueue"] = 0] = "LatestOnQueue"; + /** + * Use the latest changeset at the time the build is started. + */ + GetOption[GetOption["LatestOnBuild"] = 1] = "LatestOnBuild"; + /** + * A user-specified version has been supplied. + */ + GetOption[GetOption["Custom"] = 2] = "Custom"; +})(GetOption = exports.GetOption || (exports.GetOption = {})); +var IssueType; +(function (IssueType) { + IssueType[IssueType["Error"] = 1] = "Error"; + IssueType[IssueType["Warning"] = 2] = "Warning"; +})(IssueType = exports.IssueType || (exports.IssueType = {})); +var ProcessTemplateType; +(function (ProcessTemplateType) { + /** + * Indicates a custom template. + */ + ProcessTemplateType[ProcessTemplateType["Custom"] = 0] = "Custom"; + /** + * Indicates a default template. + */ + ProcessTemplateType[ProcessTemplateType["Default"] = 1] = "Default"; + /** + * Indicates an upgrade template. + */ + ProcessTemplateType[ProcessTemplateType["Upgrade"] = 2] = "Upgrade"; +})(ProcessTemplateType = exports.ProcessTemplateType || (exports.ProcessTemplateType = {})); +var QueryDeletedOption; +(function (QueryDeletedOption) { + /** + * Include only non-deleted builds. + */ + QueryDeletedOption[QueryDeletedOption["ExcludeDeleted"] = 0] = "ExcludeDeleted"; + /** + * Include deleted and non-deleted builds. + */ + QueryDeletedOption[QueryDeletedOption["IncludeDeleted"] = 1] = "IncludeDeleted"; + /** + * Include only deleted builds. + */ + QueryDeletedOption[QueryDeletedOption["OnlyDeleted"] = 2] = "OnlyDeleted"; +})(QueryDeletedOption = exports.QueryDeletedOption || (exports.QueryDeletedOption = {})); +var QueueOptions; +(function (QueueOptions) { + /** + * No queue options + */ + QueueOptions[QueueOptions["None"] = 0] = "None"; + /** + * Create a plan Id for the build, do not run it + */ + QueueOptions[QueueOptions["DoNotRun"] = 1] = "DoNotRun"; +})(QueueOptions = exports.QueueOptions || (exports.QueueOptions = {})); +var QueuePriority; +(function (QueuePriority) { + /** + * Low priority. + */ + QueuePriority[QueuePriority["Low"] = 5] = "Low"; + /** + * Below normal priority. + */ + QueuePriority[QueuePriority["BelowNormal"] = 4] = "BelowNormal"; + /** + * Normal priority. + */ + QueuePriority[QueuePriority["Normal"] = 3] = "Normal"; + /** + * Above normal priority. + */ + QueuePriority[QueuePriority["AboveNormal"] = 2] = "AboveNormal"; + /** + * High priority. + */ + QueuePriority[QueuePriority["High"] = 1] = "High"; +})(QueuePriority = exports.QueuePriority || (exports.QueuePriority = {})); +var RepositoryCleanOptions; +(function (RepositoryCleanOptions) { + /** + * Run git clean -fdx && git reset --hard or Tf /scorch on $(build.sourcesDirectory) + */ + RepositoryCleanOptions[RepositoryCleanOptions["Source"] = 0] = "Source"; + /** + * Run git clean -fdx && git reset --hard or Tf /scorch on $(build.sourcesDirectory), also re-create $(build.binariesDirectory) + */ + RepositoryCleanOptions[RepositoryCleanOptions["SourceAndOutputDir"] = 1] = "SourceAndOutputDir"; + /** + * Re-create $(build.sourcesDirectory) + */ + RepositoryCleanOptions[RepositoryCleanOptions["SourceDir"] = 2] = "SourceDir"; + /** + * Re-create $(agnet.buildDirectory) which contains $(build.sourcesDirectory), $(build.binariesDirectory) and any folders that left from previous build. + */ + RepositoryCleanOptions[RepositoryCleanOptions["AllBuildDir"] = 3] = "AllBuildDir"; +})(RepositoryCleanOptions = exports.RepositoryCleanOptions || (exports.RepositoryCleanOptions = {})); +var ResultSet; +(function (ResultSet) { + /** + * Include all repositories + */ + ResultSet[ResultSet["All"] = 0] = "All"; + /** + * Include most relevant repositories for user + */ + ResultSet[ResultSet["Top"] = 1] = "Top"; +})(ResultSet = exports.ResultSet || (exports.ResultSet = {})); +var ScheduleDays; +(function (ScheduleDays) { + /** + * Do not run. + */ + ScheduleDays[ScheduleDays["None"] = 0] = "None"; + /** + * Run on Monday. + */ + ScheduleDays[ScheduleDays["Monday"] = 1] = "Monday"; + /** + * Run on Tuesday. + */ + ScheduleDays[ScheduleDays["Tuesday"] = 2] = "Tuesday"; + /** + * Run on Wednesday. + */ + ScheduleDays[ScheduleDays["Wednesday"] = 4] = "Wednesday"; + /** + * Run on Thursday. + */ + ScheduleDays[ScheduleDays["Thursday"] = 8] = "Thursday"; + /** + * Run on Friday. + */ + ScheduleDays[ScheduleDays["Friday"] = 16] = "Friday"; + /** + * Run on Saturday. + */ + ScheduleDays[ScheduleDays["Saturday"] = 32] = "Saturday"; + /** + * Run on Sunday. + */ + ScheduleDays[ScheduleDays["Sunday"] = 64] = "Sunday"; + /** + * Run on all days of the week. + */ + ScheduleDays[ScheduleDays["All"] = 127] = "All"; +})(ScheduleDays = exports.ScheduleDays || (exports.ScheduleDays = {})); +var ServiceHostStatus; +(function (ServiceHostStatus) { + /** + * The service host is currently connected and accepting commands. + */ + ServiceHostStatus[ServiceHostStatus["Online"] = 1] = "Online"; + /** + * The service host is currently disconnected and not accepting commands. + */ + ServiceHostStatus[ServiceHostStatus["Offline"] = 2] = "Offline"; +})(ServiceHostStatus = exports.ServiceHostStatus || (exports.ServiceHostStatus = {})); +var SourceProviderAvailability; +(function (SourceProviderAvailability) { + /** + * The source provider is available in the hosted environment. + */ + SourceProviderAvailability[SourceProviderAvailability["Hosted"] = 1] = "Hosted"; + /** + * The source provider is available in the on-premises environment. + */ + SourceProviderAvailability[SourceProviderAvailability["OnPremises"] = 2] = "OnPremises"; + /** + * The source provider is available in all environments. + */ + SourceProviderAvailability[SourceProviderAvailability["All"] = 3] = "All"; +})(SourceProviderAvailability = exports.SourceProviderAvailability || (exports.SourceProviderAvailability = {})); +var StageUpdateType; +(function (StageUpdateType) { + StageUpdateType[StageUpdateType["Cancel"] = 0] = "Cancel"; + StageUpdateType[StageUpdateType["Retry"] = 1] = "Retry"; + StageUpdateType[StageUpdateType["Run"] = 2] = "Run"; +})(StageUpdateType = exports.StageUpdateType || (exports.StageUpdateType = {})); +var SupportLevel; +(function (SupportLevel) { + /** + * The functionality is not supported. + */ + SupportLevel[SupportLevel["Unsupported"] = 0] = "Unsupported"; + /** + * The functionality is supported. + */ + SupportLevel[SupportLevel["Supported"] = 1] = "Supported"; + /** + * The functionality is required. + */ + SupportLevel[SupportLevel["Required"] = 2] = "Required"; +})(SupportLevel = exports.SupportLevel || (exports.SupportLevel = {})); +var TaskResult; +(function (TaskResult) { + TaskResult[TaskResult["Succeeded"] = 0] = "Succeeded"; + TaskResult[TaskResult["SucceededWithIssues"] = 1] = "SucceededWithIssues"; + TaskResult[TaskResult["Failed"] = 2] = "Failed"; + TaskResult[TaskResult["Canceled"] = 3] = "Canceled"; + TaskResult[TaskResult["Skipped"] = 4] = "Skipped"; + TaskResult[TaskResult["Abandoned"] = 5] = "Abandoned"; + TaskResult[TaskResult["ManuallyQueued"] = 6] = "ManuallyQueued"; + TaskResult[TaskResult["DependentOnManualQueue"] = 7] = "DependentOnManualQueue"; +})(TaskResult = exports.TaskResult || (exports.TaskResult = {})); +var TimelineRecordState; +(function (TimelineRecordState) { + TimelineRecordState[TimelineRecordState["Pending"] = 0] = "Pending"; + TimelineRecordState[TimelineRecordState["InProgress"] = 1] = "InProgress"; + TimelineRecordState[TimelineRecordState["Completed"] = 2] = "Completed"; +})(TimelineRecordState = exports.TimelineRecordState || (exports.TimelineRecordState = {})); +var ValidationResult; +(function (ValidationResult) { + ValidationResult[ValidationResult["OK"] = 0] = "OK"; + ValidationResult[ValidationResult["Warning"] = 1] = "Warning"; + ValidationResult[ValidationResult["Error"] = 2] = "Error"; +})(ValidationResult = exports.ValidationResult || (exports.ValidationResult = {})); +var WorkspaceMappingType; +(function (WorkspaceMappingType) { + /** + * The path is mapped in the workspace. + */ + WorkspaceMappingType[WorkspaceMappingType["Map"] = 0] = "Map"; + /** + * The path is cloaked in the workspace. + */ + WorkspaceMappingType[WorkspaceMappingType["Cloak"] = 1] = "Cloak"; +})(WorkspaceMappingType = exports.WorkspaceMappingType || (exports.WorkspaceMappingType = {})); +exports.TypeInfo = { + AgentStatus: { + enumValues: { + "unavailable": 0, + "available": 1, + "offline": 2 + } + }, + AuditAction: { + enumValues: { + "add": 1, + "update": 2, + "delete": 3 + } + }, + Build: {}, + BuildAgent: {}, + BuildAuthorizationScope: { + enumValues: { + "projectCollection": 1, + "project": 2 + } + }, + BuildCompletedEvent: {}, + BuildCompletionTrigger: {}, + BuildController: {}, + BuildDefinition: {}, + BuildDefinition3_2: {}, + BuildDefinitionReference: {}, + BuildDefinitionReference3_2: {}, + BuildDefinitionRevision: {}, + BuildDefinitionSourceProvider: {}, + BuildDefinitionTemplate: {}, + BuildDefinitionTemplate3_2: {}, BuildDeletedEvent: {}, BuildDeployment: {}, BuildLog: {}, @@ -40193,7 +49827,8 @@ exports.TypeInfo = { StageUpdateType: { enumValues: { "cancel": 0, - "retry": 1 + "retry": 1, + "run": 2 } }, SupportedTrigger: {}, @@ -40211,7 +49846,9 @@ exports.TypeInfo = { "failed": 2, "canceled": 3, "skipped": 4, - "abandoned": 5 + "abandoned": 5, + "manuallyQueued": 6, + "dependentOnManualQueue": 7 } }, Timeline: {}, @@ -40837,6 +50474,7 @@ exports.TypeInfo.XamlBuildDefinition.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.CommentState = exports.CommentSortOrder = exports.CommentReactionType = exports.CommentMentionType = exports.CommentFormat = exports.CommentExpandOptions = void 0; /** * Specifies the additional data retrieval options for comments. */ @@ -40854,6 +50492,9 @@ var CommentExpandOptions; * Include the rendered text (html) in addition to markdown text */ CommentExpandOptions[CommentExpandOptions["RenderedText"] = 8] = "RenderedText"; + /** + * If specified, then ONLY rendered text (html) will be returned, w/o markdown. Supposed to be used internally from data provides for optimization purposes. + */ CommentExpandOptions[CommentExpandOptions["RenderedTextOnly"] = 16] = "RenderedTextOnly"; /** * If specified, then responses will be expanded in the results @@ -41052,6 +50693,7 @@ exports.TypeInfo.CommentVersion.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.SourceControlTypes = exports.ProjectVisibility = exports.ProjectChangeType = exports.ProcessType = exports.ProcessCustomizationType = exports.ConnectedServiceKind = void 0; var ConnectedServiceKind; (function (ConnectedServiceKind) { /** @@ -41261,6 +50903,7 @@ exports.TypeInfo.WebApiProject.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.WidgetScope = exports.TeamDashboardPermission = exports.GroupMemberPermission = exports.DashboardScope = void 0; /** * identifies the scope of dashboard storage and permissions. */ @@ -41279,6 +50922,9 @@ var DashboardScope; */ DashboardScope[DashboardScope["Project"] = 2] = "Project"; })(DashboardScope = exports.DashboardScope || (exports.DashboardScope = {})); +/** + * None - Team member cannot edit dashboard Edit - Team member can add, configure and delete widgets Manage - Team member can add, reorder, delete dashboards Manage Permissions - Team member can manage membership of other members to perform group operations. + */ var GroupMemberPermission; (function (GroupMemberPermission) { GroupMemberPermission[GroupMemberPermission["None"] = 0] = "None"; @@ -41286,6 +50932,9 @@ var GroupMemberPermission; GroupMemberPermission[GroupMemberPermission["Manage"] = 2] = "Manage"; GroupMemberPermission[GroupMemberPermission["ManagePermissions"] = 3] = "ManagePermissions"; })(GroupMemberPermission = exports.GroupMemberPermission || (exports.GroupMemberPermission = {})); +/** + * Read - User can see dashboards Create - User can create dashboards Edit - User can add, configure and delete widgets, and edit dashboard settings. Delete - User can delete dashboards Manage Permissions - Team member can manage membership of other members to perform group operations. + */ var TeamDashboardPermission; (function (TeamDashboardPermission) { TeamDashboardPermission[TeamDashboardPermission["None"] = 0] = "None"; @@ -41304,6 +50953,8 @@ var WidgetScope; WidgetScope[WidgetScope["Project_Team"] = 1] = "Project_Team"; })(WidgetScope = exports.WidgetScope || (exports.WidgetScope = {})); exports.TypeInfo = { + CopyDashboardOptions: {}, + CopyDashboardResponse: {}, Dashboard: {}, DashboardGroup: {}, DashboardGroupEntry: {}, @@ -41347,10 +50998,29 @@ exports.TypeInfo = { WidgetsVersionedList: {}, WidgetTypesResponse: {}, }; +exports.TypeInfo.CopyDashboardOptions.fields = { + copyDashboardScope: { + enumType: exports.TypeInfo.DashboardScope + } +}; +exports.TypeInfo.CopyDashboardResponse.fields = { + copiedDashboard: { + typeInfo: exports.TypeInfo.Dashboard + }, + copyDashboardOptions: { + typeInfo: exports.TypeInfo.CopyDashboardOptions + } +}; exports.TypeInfo.Dashboard.fields = { dashboardScope: { enumType: exports.TypeInfo.DashboardScope }, + lastAccessedDate: { + isDate: true, + }, + modifiedDate: { + isDate: true, + }, widgets: { isArray: true, typeInfo: exports.TypeInfo.Widget @@ -41372,6 +51042,12 @@ exports.TypeInfo.DashboardGroupEntry.fields = { dashboardScope: { enumType: exports.TypeInfo.DashboardScope }, + lastAccessedDate: { + isDate: true, + }, + modifiedDate: { + isDate: true, + }, widgets: { isArray: true, typeInfo: exports.TypeInfo.Widget @@ -41381,6 +51057,12 @@ exports.TypeInfo.DashboardGroupEntryResponse.fields = { dashboardScope: { enumType: exports.TypeInfo.DashboardScope }, + lastAccessedDate: { + isDate: true, + }, + modifiedDate: { + isDate: true, + }, widgets: { isArray: true, typeInfo: exports.TypeInfo.Widget @@ -41390,6 +51072,12 @@ exports.TypeInfo.DashboardResponse.fields = { dashboardScope: { enumType: exports.TypeInfo.DashboardScope }, + lastAccessedDate: { + isDate: true, + }, + modifiedDate: { + isDate: true, + }, widgets: { isArray: true, typeInfo: exports.TypeInfo.Widget @@ -41447,6 +51135,7 @@ exports.TypeInfo.WidgetTypesResponse.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.InstalledExtensionStateIssueType = exports.ExtensionUpdateType = exports.ExtensionStateFlags = exports.ExtensionRequestUpdateType = exports.ExtensionRequestState = exports.ExtensionFlags = exports.ContributionQueryOptions = exports.ContributionPropertyType = exports.ContributionLicensingBehaviorType = exports.AcquisitionOperationType = exports.AcquisitionOperationState = exports.AcquisitionAssignmentType = void 0; const GalleryInterfaces = __nccwpck_require__(8905); /** * How the acquisition is assigned @@ -41695,6 +51384,10 @@ var ExtensionStateFlags; * Extension is currently in a warning state, that can cause a degraded experience. The degraded experience can be caused for example by some installation issues detected such as implicit demands not supported. */ ExtensionStateFlags[ExtensionStateFlags["Warning"] = 512] = "Warning"; + /** + * Extension is currently unpublished in the marketplace. Extension usage should be reviewed and removed if it is no longer needed + */ + ExtensionStateFlags[ExtensionStateFlags["Unpublished"] = 1024] = "Unpublished"; })(ExtensionStateFlags = exports.ExtensionStateFlags || (exports.ExtensionStateFlags = {})); var ExtensionUpdateType; (function (ExtensionUpdateType) { @@ -41826,7 +51519,8 @@ exports.TypeInfo = { "error": 64, "needsReauthorization": 128, "autoUpgradeError": 256, - "warning": 512 + "warning": 512, + "unpublished": 1024 } }, ExtensionUpdateType: { @@ -42041,6 +51735,7 @@ exports.TypeInfo.RequestedExtension.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.ContributedFeatureEnabledValue = void 0; /** * The current state of a feature within a given scope */ @@ -42100,6 +51795,7 @@ exports.TypeInfo.ContributedFeatureStateQuery.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.ContainerOptions = exports.ContainerItemType = exports.ContainerItemStatus = exports.BlobCompressionType = void 0; /** * Compression type for file stored in Blobstore */ @@ -42228,6 +51924,7 @@ exports.TypeInfo.FileContainerItem.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.VSCodeWebExtensionStatisicsType = exports.SortOrderType = exports.SortByType = exports.ReviewResourceType = exports.ReviewPatchOperation = exports.ReviewFilterOptions = exports.ReviewEventOperation = exports.RestApiResponseStatus = exports.QnAItemStatus = exports.PublisherState = exports.PublisherRoleAccess = exports.PublisherQueryFlags = exports.PublisherPermissions = exports.PublisherFlags = exports.PublishedExtensionFlags = exports.PagingDirection = exports.NotificationTemplateType = exports.ExtensionVersionFlags = exports.ExtensionStatsAggregateType = exports.ExtensionStatisticOperation = exports.ExtensionQueryFlags = exports.ExtensionQueryFilterType = exports.ExtensionPolicyFlags = exports.ExtensionLifecycleEventType = exports.ExtensionDeploymentTechnology = exports.DraftStateType = exports.DraftPatchOperation = exports.ConcernCategory = exports.AcquisitionOperationType = exports.AcquisitionOperationState = exports.AcquisitionAssignmentType = void 0; /** * How the acquisition is assigned */ @@ -42452,6 +52149,18 @@ var ExtensionQueryFilterType; * Filter to get extensions shared with particular organization */ ExtensionQueryFilterType[ExtensionQueryFilterType["OrganizationSharedWith"] = 21] = "OrganizationSharedWith"; + /** + * Filter to get VS IDE extensions by Product Architecture + */ + ExtensionQueryFilterType[ExtensionQueryFilterType["ProductArchitecture"] = 22] = "ProductArchitecture"; + /** + * Filter to get VS Code extensions by target platform. + */ + ExtensionQueryFilterType[ExtensionQueryFilterType["TargetPlatform"] = 23] = "TargetPlatform"; + /** + * Retrieve an extension based on the extensionName. + */ + ExtensionQueryFilterType[ExtensionQueryFilterType["ExtensionName"] = 24] = "ExtensionName"; })(ExtensionQueryFilterType = exports.ExtensionQueryFilterType || (exports.ExtensionQueryFilterType = {})); /** * Set of flags used to determine which set of information is retrieved when reading published extensions @@ -42522,6 +52231,14 @@ var ExtensionQueryFlags; * Include the details about which organizations the extension has been shared with if the extension is a private extension. */ ExtensionQueryFlags[ExtensionQueryFlags["IncludeSharedOrganizations"] = 16384] = "IncludeSharedOrganizations"; + /** + * Include the details if an extension is in conflict list or not Currently being used for VSCode extensions. + */ + ExtensionQueryFlags[ExtensionQueryFlags["IncludeNameConflictInfo"] = 32768] = "IncludeNameConflictInfo"; + /** + * When retrieving versions from a query, return the details with both latest prelease and stable version of the extensions that matched, if not prelease version, only return stable version. This is useful when the caller doesn't need all the published versions. It will save a significant size in the returned payload. + */ + ExtensionQueryFlags[ExtensionQueryFlags["IncludeLatestPrereleaseAndStableVersionOnly"] = 65536] = "IncludeLatestPrereleaseAndStableVersionOnly"; /** * AllAttributes is designed to be a mask that defines all sub-elements of the extension should be returned. NOTE: This is not actually All flags. This is now locked to the set defined since changing this enum would be a breaking change and would change the behavior of anyone using it. Try not to use this value when making calls to the service, instead be explicit about the options required. */ @@ -42552,9 +52269,13 @@ var ExtensionVersionFlags; */ ExtensionVersionFlags[ExtensionVersionFlags["None"] = 0] = "None"; /** - * The Validated flag for a version means the extension version has passed validation and can be used.. + * The Validated flag for a version means the extension version has passed validation and can be used. */ ExtensionVersionFlags[ExtensionVersionFlags["Validated"] = 1] = "Validated"; + /** + * The Prerelease flag for a version means the extension version is prerelease. This flag is runtime only. We need backfill this flag to database in the future, here is a tracking task: https://dev.azure.com/mseng/AzureDevOps/_workitems/edit/2234733 + */ + ExtensionVersionFlags[ExtensionVersionFlags["Prerelease"] = 2] = "Prerelease"; })(ExtensionVersionFlags = exports.ExtensionVersionFlags || (exports.ExtensionVersionFlags = {})); /** * Type of event @@ -42966,6 +52687,12 @@ var SortOrderType; */ SortOrderType[SortOrderType["Descending"] = 2] = "Descending"; })(SortOrderType = exports.SortOrderType || (exports.SortOrderType = {})); +var VSCodeWebExtensionStatisicsType; +(function (VSCodeWebExtensionStatisicsType) { + VSCodeWebExtensionStatisicsType[VSCodeWebExtensionStatisicsType["Install"] = 1] = "Install"; + VSCodeWebExtensionStatisicsType[VSCodeWebExtensionStatisicsType["Update"] = 2] = "Update"; + VSCodeWebExtensionStatisicsType[VSCodeWebExtensionStatisicsType["Uninstall"] = 3] = "Uninstall"; +})(VSCodeWebExtensionStatisicsType = exports.VSCodeWebExtensionStatisicsType || (exports.VSCodeWebExtensionStatisicsType = {})); exports.TypeInfo = { AcquisitionAssignmentType: { enumValues: { @@ -43081,7 +52808,10 @@ exports.TypeInfo = { "publisherName": 18, "publisherDisplayName": 19, "includeWithPublisherFlags": 20, - "organizationSharedWith": 21 + "organizationSharedWith": 21, + "productArchitecture": 22, + "targetPlatform": 23, + "extensionName": 24 } }, ExtensionQueryFlags: { @@ -43102,6 +52832,8 @@ exports.TypeInfo = { "includeMinimalPayloadForVsIde": 4096, "includeLcids": 8192, "includeSharedOrganizations": 16384, + "includeNameConflictInfo": 32768, + "includeLatestPrereleaseAndStableVersionOnly": 65536, "allAttributes": 16863 } }, @@ -43125,7 +52857,8 @@ exports.TypeInfo = { ExtensionVersionFlags: { enumValues: { "none": 0, - "validated": 1 + "validated": 1, + "prerelease": 2 } }, NotificationsData: {}, @@ -43300,6 +53033,13 @@ exports.TypeInfo = { }, UserExtensionPolicy: {}, UserReportedConcern: {}, + VSCodeWebExtensionStatisicsType: { + enumValues: { + "install": 1, + "update": 2, + "uninstall": 3 + } + }, }; exports.TypeInfo.AcquisitionOperation.fields = { operationState: { @@ -43668,6 +53408,7 @@ exports.TypeInfo.UserReportedConcern.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.VersionControlRecursionType = exports.VersionControlChangeType = exports.TfvcVersionType = exports.TfvcVersionOption = exports.SupportedIdeType = exports.RefFavoriteType = exports.PullRequestTimeRangeType = exports.PullRequestStatus = exports.PullRequestMergeFailureType = exports.PullRequestAsyncStatus = exports.LineDiffBlockChangeType = exports.IterationReason = exports.ItemContentType = exports.GitVersionType = exports.GitVersionOptions = exports.GitStatusState = exports.GitResolutionWhichAction = exports.GitResolutionStatus = exports.GitResolutionRename1to2Action = exports.GitResolutionPathConflictAction = exports.GitResolutionMergeType = exports.GitResolutionError = exports.GitRefUpdateStatus = exports.GitRefUpdateMode = exports.GitRefSearchType = exports.GitPullRequestReviewFileType = exports.GitPullRequestQueryType = exports.GitPullRequestQueryIncludeOptions = exports.GitPullRequestMergeStrategy = exports.GitPathActions = exports.GitObjectType = exports.GitHistoryMode = exports.GitConflictUpdateStatus = exports.GitConflictType = exports.GitAsyncRefOperationFailureStatus = exports.GitAsyncOperationStatus = exports.CommentType = exports.CommentThreadStatus = void 0; const PolicyInterfaces = __nccwpck_require__(8555); const TfsCoreInterfaces = __nccwpck_require__(3931); /** @@ -43954,6 +53695,20 @@ var GitPullRequestMergeStrategy; */ GitPullRequestMergeStrategy[GitPullRequestMergeStrategy["RebaseMerge"] = 4] = "RebaseMerge"; })(GitPullRequestMergeStrategy = exports.GitPullRequestMergeStrategy || (exports.GitPullRequestMergeStrategy = {})); +/** + * Options for including additional elements in the pull request query response. + */ +var GitPullRequestQueryIncludeOptions; +(function (GitPullRequestQueryIncludeOptions) { + /** + * No additional elements included. + */ + GitPullRequestQueryIncludeOptions[GitPullRequestQueryIncludeOptions["NotSet"] = 0] = "NotSet"; + /** + * Enforces adding associated labels to the response. + */ + GitPullRequestQueryIncludeOptions[GitPullRequestQueryIncludeOptions["Labels"] = 1] = "Labels"; +})(GitPullRequestQueryIncludeOptions = exports.GitPullRequestQueryIncludeOptions || (exports.GitPullRequestQueryIncludeOptions = {})); /** * Accepted types of pull request queries. */ @@ -44171,6 +53926,10 @@ var GitStatusState; * Status is not applicable to the target object. */ GitStatusState[GitStatusState["NotApplicable"] = 5] = "NotApplicable"; + /** + * Status Partially Succeeded, build finished with warnings. + */ + GitStatusState[GitStatusState["PartiallySucceeded"] = 6] = "PartiallySucceeded"; })(GitStatusState = exports.GitStatusState || (exports.GitStatusState = {})); /** * Accepted types of version options @@ -44224,6 +53983,7 @@ var IterationReason; IterationReason[IterationReason["Rebase"] = 4] = "Rebase"; IterationReason[IterationReason["Unknown"] = 8] = "Unknown"; IterationReason[IterationReason["Retarget"] = 16] = "Retarget"; + IterationReason[IterationReason["ResolveConflicts"] = 32] = "ResolveConflicts"; })(IterationReason = exports.IterationReason || (exports.IterationReason = {})); /** * Type of change for a line diff block @@ -44325,6 +54085,20 @@ var PullRequestStatus; */ PullRequestStatus[PullRequestStatus["All"] = 4] = "All"; })(PullRequestStatus = exports.PullRequestStatus || (exports.PullRequestStatus = {})); +/** + * Specifies the desired type of time range for pull requests queries. + */ +var PullRequestTimeRangeType; +(function (PullRequestTimeRangeType) { + /** + * The date when the pull request was created. + */ + PullRequestTimeRangeType[PullRequestTimeRangeType["Created"] = 1] = "Created"; + /** + * The date when the pull request was closed (completed, abandoned, or merged externally). + */ + PullRequestTimeRangeType[PullRequestTimeRangeType["Closed"] = 2] = "Closed"; +})(PullRequestTimeRangeType = exports.PullRequestTimeRangeType || (exports.PullRequestTimeRangeType = {})); var RefFavoriteType; (function (RefFavoriteType) { RefFavoriteType[RefFavoriteType["Invalid"] = 0] = "Invalid"; @@ -44446,7 +54220,9 @@ var VersionControlRecursionType; VersionControlRecursionType[VersionControlRecursionType["Full"] = 120] = "Full"; })(VersionControlRecursionType = exports.VersionControlRecursionType || (exports.VersionControlRecursionType = {})); exports.TypeInfo = { + AdvSecEnablementStatus: {}, Attachment: {}, + BillableCommitterDetail: {}, Change: {}, ChangeList: {}, Comment: {}, @@ -44612,6 +54388,12 @@ exports.TypeInfo = { } }, GitPullRequestQuery: {}, + GitPullRequestQueryIncludeOptions: { + enumValues: { + "notSet": 0, + "labels": 1 + } + }, GitPullRequestQueryInput: {}, GitPullRequestQueryType: { enumValues: { @@ -44738,7 +54520,8 @@ exports.TypeInfo = { "succeeded": 2, "failed": 3, "error": 4, - "notApplicable": 5 + "notApplicable": 5, + "partiallySucceeded": 6 } }, GitTargetVersionDescriptor: {}, @@ -44780,7 +54563,8 @@ exports.TypeInfo = { "create": 2, "rebase": 4, "unknown": 8, - "retarget": 16 + "retarget": 16, + "resolveConflicts": 32 } }, LineDiffBlock: {}, @@ -44819,6 +54603,12 @@ exports.TypeInfo = { "all": 4 } }, + PullRequestTimeRangeType: { + enumValues: { + "created": 1, + "closed": 2 + } + }, RefFavoriteType: { enumValues: { "invalid": 0, @@ -44911,11 +54701,24 @@ exports.TypeInfo = { } }, }; +exports.TypeInfo.AdvSecEnablementStatus.fields = { + changedOnDate: { + isDate: true, + } +}; exports.TypeInfo.Attachment.fields = { createdDate: { isDate: true, } }; +exports.TypeInfo.BillableCommitterDetail.fields = { + commitTime: { + isDate: true, + }, + pushedTime: { + isDate: true, + } +}; exports.TypeInfo.Change.fields = { changeType: { enumType: exports.TypeInfo.VersionControlChangeType @@ -45714,11 +55517,23 @@ exports.TypeInfo.GitPullRequestQuery.fields = { }, }; exports.TypeInfo.GitPullRequestQueryInput.fields = { + include: { + enumType: exports.TypeInfo.GitPullRequestQueryIncludeOptions + }, type: { enumType: exports.TypeInfo.GitPullRequestQueryType } }; exports.TypeInfo.GitPullRequestSearchCriteria.fields = { + maxTime: { + isDate: true, + }, + minTime: { + isDate: true, + }, + queryTimeRangeType: { + enumType: exports.TypeInfo.PullRequestTimeRangeType + }, status: { enumType: exports.TypeInfo.PullRequestStatus } @@ -45810,6 +55625,9 @@ exports.TypeInfo.GitRefUpdateResult.fields = { } }; exports.TypeInfo.GitRepository.fields = { + creationDate: { + isDate: true, + }, parentRepository: { typeInfo: exports.TypeInfo.GitRepositoryRef }, @@ -46106,6 +55924,7 @@ exports.TypeInfo.VersionControlProjectInfo.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.ServiceStatus = exports.RelativeToSetting = exports.InheritLevel = void 0; const VSSInterfaces = __nccwpck_require__(4498); var InheritLevel; (function (InheritLevel) { @@ -46185,6 +56004,135 @@ exports.TypeInfo.ServiceDefinition.fields = { }; +/***/ }), + +/***/ 9471: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.Plan = void 0; +var Plan; +(function (Plan) { + /** + * No plan is indicated + */ + Plan[Plan["None"] = 0] = "None"; + /** + * The Code Security plan + */ + Plan[Plan["CodeSecurity"] = 1] = "CodeSecurity"; + /** + * The Secret Protection plan + */ + Plan[Plan["SecretProtection"] = 2] = "SecretProtection"; + /** + * Include all plans + */ + Plan[Plan["All"] = 3] = "All"; +})(Plan = exports.Plan || (exports.Plan = {})); +exports.TypeInfo = { + AdvSecEnablementSettings: {}, + AdvSecEnablementStatus: {}, + BillableCommitterDetails: {}, + CodeSecurityFeatures: {}, + MeterUsage: {}, + MeterUsageForPlan: {}, + OrgEnablementSettings: {}, + Plan: { + enumValues: { + "codeSecurity": 1, + "secretProtection": 2, + "all": 3 + } + }, + ProjectEnablementSettings: {}, + RepoEnablementSettings: {}, + SecretProtectionFeatures: {}, +}; +exports.TypeInfo.AdvSecEnablementSettings.fields = { + reposEnablementStatus: { + isArray: true, + typeInfo: exports.TypeInfo.AdvSecEnablementStatus + } +}; +exports.TypeInfo.AdvSecEnablementStatus.fields = { + advSecEnablementLastChangedDate: { + isDate: true, + } +}; +exports.TypeInfo.BillableCommitterDetails.fields = { + commitTime: { + isDate: true, + }, + pushedTime: { + isDate: true, + } +}; +exports.TypeInfo.CodeSecurityFeatures.fields = { + codeSecurityEnablementLastChangedDate: { + isDate: true, + } +}; +exports.TypeInfo.MeterUsage.fields = { + billingDate: { + isDate: true, + } +}; +exports.TypeInfo.MeterUsageForPlan.fields = { + billingDate: { + isDate: true, + } +}; +exports.TypeInfo.OrgEnablementSettings.fields = { + codeSecurityFeatures: { + typeInfo: exports.TypeInfo.CodeSecurityFeatures + }, + reposEnablementStatus: { + isArray: true, + typeInfo: exports.TypeInfo.RepoEnablementSettings + }, + secretProtectionFeatures: { + typeInfo: exports.TypeInfo.SecretProtectionFeatures + } +}; +exports.TypeInfo.ProjectEnablementSettings.fields = { + codeSecurityFeatures: { + typeInfo: exports.TypeInfo.CodeSecurityFeatures + }, + reposEnablementStatus: { + isArray: true, + typeInfo: exports.TypeInfo.RepoEnablementSettings + }, + secretProtectionFeatures: { + typeInfo: exports.TypeInfo.SecretProtectionFeatures + } +}; +exports.TypeInfo.RepoEnablementSettings.fields = { + codeSecurityFeatures: { + typeInfo: exports.TypeInfo.CodeSecurityFeatures + }, + secretProtectionFeatures: { + typeInfo: exports.TypeInfo.SecretProtectionFeatures + } +}; +exports.TypeInfo.SecretProtectionFeatures.fields = { + secretProtectionEnablementLastChangedDate: { + isDate: true, + } +}; + + /***/ }), /***/ 3044: @@ -46202,12 +56150,19 @@ exports.TypeInfo.ServiceDefinition.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.SubscriptionTemplateType = exports.SubscriptionTemplateQueryFlags = exports.SubscriptionStatus = exports.SubscriptionQueryFlags = exports.SubscriptionPermissions = exports.SubscriptionFlags = exports.SubscriptionFieldType = exports.SubscriberFlags = exports.NotificationSubscriberDeliveryPreference = exports.NotificationStatisticType = exports.NotificationReasonType = exports.NotificationOperation = exports.EventTypeQueryFlags = exports.EventPublisherQueryFlags = exports.EvaluationOperationStatus = exports.DefaultGroupDeliveryPreference = void 0; /** * Default delivery preference for group subscribers. Indicates how the subscriber should be notified. */ var DefaultGroupDeliveryPreference; (function (DefaultGroupDeliveryPreference) { + /** + * Do not send notifications by default. Note: notifications can still be delivered to subscribers, for example via a custom subscription. + */ DefaultGroupDeliveryPreference[DefaultGroupDeliveryPreference["NoDelivery"] = -1] = "NoDelivery"; + /** + * Deliver notifications to each member of the group representing the subscriber. Only applicable when the subscriber is a group. + */ DefaultGroupDeliveryPreference[DefaultGroupDeliveryPreference["EachMember"] = 2] = "EachMember"; })(DefaultGroupDeliveryPreference = exports.DefaultGroupDeliveryPreference || (exports.DefaultGroupDeliveryPreference = {})); /** @@ -47065,6 +57020,245 @@ exports.TypeInfo.SubscriptionTracing.fields = { }; +/***/ }), + +/***/ 5871: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.RunState = exports.RunResult = exports.RepositoryType = exports.GetLogExpandOptions = exports.GetArtifactExpandOptions = exports.ConfigurationType = void 0; +const VSSInterfaces = __nccwpck_require__(4498); +var ConfigurationType; +(function (ConfigurationType) { + /** + * Unknown type. + */ + ConfigurationType[ConfigurationType["Unknown"] = 0] = "Unknown"; + /** + * YAML. + */ + ConfigurationType[ConfigurationType["Yaml"] = 1] = "Yaml"; + /** + * Designer JSON. + */ + ConfigurationType[ConfigurationType["DesignerJson"] = 2] = "DesignerJson"; + /** + * Just-in-time. + */ + ConfigurationType[ConfigurationType["JustInTime"] = 3] = "JustInTime"; + /** + * Designer-JSON. + */ + ConfigurationType[ConfigurationType["DesignerHyphenJson"] = 2] = "DesignerHyphenJson"; +})(ConfigurationType = exports.ConfigurationType || (exports.ConfigurationType = {})); +/** + * Expansion options for GetArtifact and ListArtifacts. + */ +var GetArtifactExpandOptions; +(function (GetArtifactExpandOptions) { + /** + * No expansion. + */ + GetArtifactExpandOptions[GetArtifactExpandOptions["None"] = 0] = "None"; + /** + * Include signed content. + */ + GetArtifactExpandOptions[GetArtifactExpandOptions["SignedContent"] = 1] = "SignedContent"; +})(GetArtifactExpandOptions = exports.GetArtifactExpandOptions || (exports.GetArtifactExpandOptions = {})); +/** + * $expand options for GetLog and ListLogs. + */ +var GetLogExpandOptions; +(function (GetLogExpandOptions) { + GetLogExpandOptions[GetLogExpandOptions["None"] = 0] = "None"; + GetLogExpandOptions[GetLogExpandOptions["SignedContent"] = 1] = "SignedContent"; +})(GetLogExpandOptions = exports.GetLogExpandOptions || (exports.GetLogExpandOptions = {})); +var RepositoryType; +(function (RepositoryType) { + RepositoryType[RepositoryType["Unknown"] = 0] = "Unknown"; + RepositoryType[RepositoryType["GitHub"] = 1] = "GitHub"; + RepositoryType[RepositoryType["AzureReposGit"] = 2] = "AzureReposGit"; + RepositoryType[RepositoryType["GitHubEnterprise"] = 3] = "GitHubEnterprise"; + RepositoryType[RepositoryType["BitBucket"] = 4] = "BitBucket"; + RepositoryType[RepositoryType["AzureReposGitHyphenated"] = 2] = "AzureReposGitHyphenated"; +})(RepositoryType = exports.RepositoryType || (exports.RepositoryType = {})); +/** + * This is not a Flags enum because we don't want to set multiple results on a build. However, when adding values, please stick to powers of 2 as if it were a Flags enum. This will make it easier to query multiple results. + */ +var RunResult; +(function (RunResult) { + RunResult[RunResult["Unknown"] = 0] = "Unknown"; + RunResult[RunResult["Succeeded"] = 1] = "Succeeded"; + RunResult[RunResult["Failed"] = 2] = "Failed"; + RunResult[RunResult["Canceled"] = 4] = "Canceled"; +})(RunResult = exports.RunResult || (exports.RunResult = {})); +/** + * This is not a Flags enum because we don't want to set multiple states on a build. However, when adding values, please stick to powers of 2 as if it were a Flags enum. This will make it easier to query multiple states. + */ +var RunState; +(function (RunState) { + RunState[RunState["Unknown"] = 0] = "Unknown"; + RunState[RunState["InProgress"] = 1] = "InProgress"; + RunState[RunState["Canceling"] = 2] = "Canceling"; + RunState[RunState["Completed"] = 4] = "Completed"; +})(RunState = exports.RunState || (exports.RunState = {})); +exports.TypeInfo = { + Artifact: {}, + ConfigurationType: { + enumValues: { + "unknown": 0, + "yaml": 1, + "designerJson": 2, + "justInTime": 3, + "designerHyphenJson": 2 + } + }, + CreatePipelineConfigurationParameters: {}, + CreatePipelineParameters: {}, + GetArtifactExpandOptions: { + enumValues: { + "none": 0, + "signedContent": 1 + } + }, + GetLogExpandOptions: { + enumValues: { + "none": 0, + "signedContent": 1 + } + }, + Log: {}, + LogCollection: {}, + Pipeline: {}, + PipelineConfiguration: {}, + Repository: {}, + RepositoryResource: {}, + RepositoryType: { + enumValues: { + "unknown": 0, + "gitHub": 1, + "azureReposGit": 2, + "gitHubEnterprise": 3, + "bitBucket": 4, + "azureReposGitHyphenated": 2 + } + }, + Run: {}, + RunResources: {}, + RunResult: { + enumValues: { + "unknown": 0, + "succeeded": 1, + "failed": 2, + "canceled": 4 + } + }, + RunState: { + enumValues: { + "unknown": 0, + "inProgress": 1, + "canceling": 2, + "completed": 4 + } + }, + SignalRConnection: {}, +}; +exports.TypeInfo.Artifact.fields = { + signedContent: { + typeInfo: VSSInterfaces.TypeInfo.SignedUrl + } +}; +exports.TypeInfo.CreatePipelineConfigurationParameters.fields = { + type: { + enumType: exports.TypeInfo.ConfigurationType + } +}; +exports.TypeInfo.CreatePipelineParameters.fields = { + configuration: { + typeInfo: exports.TypeInfo.CreatePipelineConfigurationParameters + } +}; +exports.TypeInfo.Log.fields = { + createdOn: { + isDate: true, + }, + lastChangedOn: { + isDate: true, + }, + signedContent: { + typeInfo: VSSInterfaces.TypeInfo.SignedUrl + } +}; +exports.TypeInfo.LogCollection.fields = { + logs: { + isArray: true, + typeInfo: exports.TypeInfo.Log + }, + signedContent: { + typeInfo: VSSInterfaces.TypeInfo.SignedUrl + } +}; +exports.TypeInfo.Pipeline.fields = { + configuration: { + typeInfo: exports.TypeInfo.PipelineConfiguration + } +}; +exports.TypeInfo.PipelineConfiguration.fields = { + type: { + enumType: exports.TypeInfo.ConfigurationType + } +}; +exports.TypeInfo.Repository.fields = { + type: { + enumType: exports.TypeInfo.RepositoryType + } +}; +exports.TypeInfo.RepositoryResource.fields = { + repository: { + typeInfo: exports.TypeInfo.Repository + } +}; +exports.TypeInfo.Run.fields = { + createdDate: { + isDate: true, + }, + finishedDate: { + isDate: true, + }, + resources: { + typeInfo: exports.TypeInfo.RunResources + }, + result: { + enumType: exports.TypeInfo.RunResult + }, + state: { + enumType: exports.TypeInfo.RunState + } +}; +exports.TypeInfo.RunResources.fields = { + repositories: { + isDictionary: true, + dictionaryValueTypeInfo: exports.TypeInfo.RepositoryResource + } +}; +exports.TypeInfo.SignalRConnection.fields = { + signedContent: { + typeInfo: VSSInterfaces.TypeInfo.SignedUrl + } +}; + + /***/ }), /***/ 8555: @@ -47082,6 +57276,7 @@ exports.TypeInfo.SubscriptionTracing.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.PolicyEvaluationStatus = void 0; /** * Status of a policy which is running against a specific pull request. */ @@ -47164,6 +57359,7 @@ exports.TypeInfo.PolicyEvaluationRecord.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.AvatarSize = void 0; var AvatarSize; (function (AvatarSize) { AvatarSize[AvatarSize["Small"] = 0] = "Small"; @@ -47289,6 +57485,7 @@ exports.TypeInfo.ProfileRegions.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.ResultPhase = exports.AggregationType = void 0; var AggregationType; (function (AggregationType) { AggregationType[AggregationType["Hourly"] = 0] = "Hourly"; @@ -47371,6 +57568,7 @@ exports.TypeInfo.RepositoryLanguageAnalytics.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.YamlFileSourceTypes = exports.VariableGroupActionFilter = exports.TaskStatus = exports.SingleReleaseExpands = exports.SenderType = exports.ScheduleDays = exports.ReleaseTriggerType = exports.ReleaseStatus = exports.ReleaseReason = exports.ReleaseQueryOrder = exports.ReleaseExpands = exports.ReleaseEnvironmentExpands = exports.ReleaseDefinitionSource = exports.ReleaseDefinitionQueryOrder = exports.ReleaseDefinitionExpands = exports.PullRequestSystemType = exports.PropertySelectorType = exports.PipelineProcessTypes = exports.ParallelExecutionTypes = exports.ManualInterventionType = exports.ManualInterventionStatus = exports.MailSectionType = exports.IssueSource = exports.GateStatus = exports.FolderPathQueryOrder = exports.EnvironmentTriggerType = exports.EnvironmentStatus = exports.DeployPhaseTypes = exports.DeployPhaseStatus = exports.DeploymentStatus = exports.DeploymentsQueryType = exports.DeploymentReason = exports.DeploymentOperationStatus = exports.DeploymentExpands = exports.DeploymentAuthorizationOwner = exports.ConditionType = exports.AuthorizationHeaderFor = exports.AuditAction = exports.ApprovalType = exports.ApprovalStatus = exports.ApprovalFilters = exports.ApprovalExecutionOrder = exports.AgentArtifactType = void 0; const FormInputInterfaces = __nccwpck_require__(3627); var AgentArtifactType; (function (AgentArtifactType) { @@ -47821,6 +58019,9 @@ var EnvironmentTriggerType; */ EnvironmentTriggerType[EnvironmentTriggerType["RollbackRedeploy"] = 2] = "RollbackRedeploy"; })(EnvironmentTriggerType = exports.EnvironmentTriggerType || (exports.EnvironmentTriggerType = {})); +/** + * Specifies the desired ordering of folders. + */ var FolderPathQueryOrder; (function (FolderPathQueryOrder) { /** @@ -47903,7 +58104,25 @@ var ManualInterventionStatus; * The manual intervention is canceled. */ ManualInterventionStatus[ManualInterventionStatus["Canceled"] = 8] = "Canceled"; + /** + * The manual intervention is bypassed. + */ + ManualInterventionStatus[ManualInterventionStatus["Bypassed"] = 16] = "Bypassed"; })(ManualInterventionStatus = exports.ManualInterventionStatus || (exports.ManualInterventionStatus = {})); +/** + * Describes manual intervention status + */ +var ManualInterventionType; +(function (ManualInterventionType) { + /** + * The manual intervention server task. + */ + ManualInterventionType[ManualInterventionType["Task"] = 1] = "Task"; + /** + * The manual intervention proof of presence server task. + */ + ManualInterventionType[ManualInterventionType["ProofOfPresence"] = 2] = "ProofOfPresence"; +})(ManualInterventionType = exports.ManualInterventionType || (exports.ManualInterventionType = {})); var ParallelExecutionTypes; (function (ParallelExecutionTypes) { ParallelExecutionTypes[ParallelExecutionTypes["None"] = 0] = "None"; @@ -48477,7 +58696,14 @@ exports.TypeInfo = { "pending": 1, "rejected": 2, "approved": 4, - "canceled": 8 + "canceled": 8, + "bypassed": 16 + } + }, + ManualInterventionType: { + enumValues: { + "task": 1, + "proofOfPresence": 2 } }, ManualInterventionUpdateMetadata: {}, @@ -48926,6 +59152,9 @@ exports.TypeInfo.DeploymentJob.fields = { } }; exports.TypeInfo.DeploymentManualInterventionPendingEvent.fields = { + approval: { + typeInfo: exports.TypeInfo.ReleaseApproval + }, deployment: { typeInfo: exports.TypeInfo.Deployment }, @@ -49026,6 +59255,9 @@ exports.TypeInfo.ManualIntervention.fields = { }, status: { enumType: exports.TypeInfo.ManualInterventionStatus + }, + type: { + enumType: exports.TypeInfo.ManualInterventionType } }; exports.TypeInfo.ManualInterventionUpdateMetadata.fields = { @@ -49543,6 +59775,7 @@ exports.TypeInfo.YamlPipelineProcess.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.RoleAccess = void 0; var RoleAccess; (function (RoleAccess) { /** @@ -49587,6 +59820,7 @@ exports.TypeInfo.RoleAssignment.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.VariableGroupQueryOrder = exports.VariableGroupActionFilter = exports.TimelineRecordState = exports.TaskResult = exports.TaskOrchestrationPlanState = exports.TaskOrchestrationItemType = exports.TaskGroupQueryOrder = exports.TaskGroupExpands = exports.TaskDefinitionStatus = exports.TaskCommandMode = exports.TaskAgentUpdateReasonType = exports.TaskAgentStatusFilter = exports.TaskAgentStatus = exports.TaskAgentRequestUpdateOptions = exports.TaskAgentQueueActionFilter = exports.TaskAgentPoolType = exports.TaskAgentPoolOptions = exports.TaskAgentPoolMaintenanceScheduleDays = exports.TaskAgentPoolMaintenanceJobStatus = exports.TaskAgentPoolMaintenanceJobResult = exports.TaskAgentPoolActionFilter = exports.TaskAgentJobStepType = exports.TaskAgentJobResultFilter = exports.StageTriggerType = exports.SecureFileActionFilter = exports.ResourceLockStatus = exports.PlanGroupStatusFilter = exports.PlanGroupStatus = exports.OrchestrationType = exports.OperationType = exports.OperatingSystemType = exports.MaskType = exports.MachineGroupActionFilter = exports.LogLevel = exports.IssueType = exports.ExclusiveLockType = exports.EnvironmentResourceType = exports.EnvironmentExpands = exports.EnvironmentActionFilter = exports.ElasticPoolState = exports.ElasticNodeState = exports.ElasticComputeState = exports.ElasticAgentState = exports.DeploymentTargetExpands = exports.DeploymentPoolSummaryExpands = exports.DeploymentMachineExpands = exports.DeploymentGroupExpands = exports.DeploymentGroupActionFilter = exports.DemandSourceType = exports.AuditAction = exports.AadLoginPromptOption = void 0; const FormInputInterfaces = __nccwpck_require__(3627); var AadLoginPromptOption; (function (AadLoginPromptOption) { @@ -49720,6 +59954,9 @@ var ElasticComputeState; ElasticComputeState[ElasticComputeState["Deleting"] = 3] = "Deleting"; ElasticComputeState[ElasticComputeState["Failed"] = 4] = "Failed"; ElasticComputeState[ElasticComputeState["Stopped"] = 5] = "Stopped"; + ElasticComputeState[ElasticComputeState["Reimaging"] = 6] = "Reimaging"; + ElasticComputeState[ElasticComputeState["UnhealthyVm"] = 7] = "UnhealthyVm"; + ElasticComputeState[ElasticComputeState["UnhealthyVmssVm"] = 8] = "UnhealthyVmssVm"; })(ElasticComputeState = exports.ElasticComputeState || (exports.ElasticComputeState = {})); var ElasticNodeState; (function (ElasticNodeState) { @@ -49736,6 +59973,16 @@ var ElasticNodeState; ElasticNodeState[ElasticNodeState["DeletingCompute"] = 10] = "DeletingCompute"; ElasticNodeState[ElasticNodeState["Deleted"] = 11] = "Deleted"; ElasticNodeState[ElasticNodeState["Lost"] = 12] = "Lost"; + ElasticNodeState[ElasticNodeState["ReimagingCompute"] = 13] = "ReimagingCompute"; + ElasticNodeState[ElasticNodeState["RestartingAgent"] = 14] = "RestartingAgent"; + ElasticNodeState[ElasticNodeState["FailedToStartPendingDelete"] = 15] = "FailedToStartPendingDelete"; + ElasticNodeState[ElasticNodeState["FailedToRestartPendingDelete"] = 16] = "FailedToRestartPendingDelete"; + ElasticNodeState[ElasticNodeState["FailedVMPendingDelete"] = 17] = "FailedVMPendingDelete"; + ElasticNodeState[ElasticNodeState["AssignedPendingDelete"] = 18] = "AssignedPendingDelete"; + ElasticNodeState[ElasticNodeState["RetryDelete"] = 19] = "RetryDelete"; + ElasticNodeState[ElasticNodeState["UnhealthyVm"] = 20] = "UnhealthyVm"; + ElasticNodeState[ElasticNodeState["UnhealthyVmPendingDelete"] = 21] = "UnhealthyVmPendingDelete"; + ElasticNodeState[ElasticNodeState["PendingReimageCandidate"] = 22] = "PendingReimageCandidate"; })(ElasticNodeState = exports.ElasticNodeState || (exports.ElasticNodeState = {})); var ElasticPoolState; (function (ElasticPoolState) { @@ -49798,6 +60045,16 @@ var EnvironmentResourceType; */ EnvironmentResourceType[EnvironmentResourceType["Kubernetes"] = 4] = "Kubernetes"; })(EnvironmentResourceType = exports.EnvironmentResourceType || (exports.EnvironmentResourceType = {})); +var ExclusiveLockType; +(function (ExclusiveLockType) { + ExclusiveLockType[ExclusiveLockType["RunLatest"] = 0] = "RunLatest"; + ExclusiveLockType[ExclusiveLockType["Sequential"] = 1] = "Sequential"; + ExclusiveLockType[ExclusiveLockType["BranchRunLatest"] = 2] = "BranchRunLatest"; + ExclusiveLockType[ExclusiveLockType["Parallel"] = 3] = "Parallel"; +})(ExclusiveLockType = exports.ExclusiveLockType || (exports.ExclusiveLockType = {})); +/** + * The type of issue based on severity. + */ var IssueType; (function (IssueType) { IssueType[IssueType["Error"] = 1] = "Error"; @@ -49833,6 +60090,11 @@ var OperationType; OperationType[OperationType["Reimage"] = 3] = "Reimage"; OperationType[OperationType["DeleteVMs"] = 4] = "DeleteVMs"; })(OperationType = exports.OperationType || (exports.OperationType = {})); +var OrchestrationType; +(function (OrchestrationType) { + OrchestrationType[OrchestrationType["Uniform"] = 0] = "Uniform"; + OrchestrationType[OrchestrationType["Flexible"] = 1] = "Flexible"; +})(OrchestrationType = exports.OrchestrationType || (exports.OrchestrationType = {})); var PlanGroupStatus; (function (PlanGroupStatus) { PlanGroupStatus[PlanGroupStatus["Running"] = 1] = "Running"; @@ -49853,6 +60115,7 @@ var ResourceLockStatus; ResourceLockStatus[ResourceLockStatus["TimedOut"] = 3] = "TimedOut"; ResourceLockStatus[ResourceLockStatus["Canceled"] = 4] = "Canceled"; ResourceLockStatus[ResourceLockStatus["Abandoned"] = 5] = "Abandoned"; + ResourceLockStatus[ResourceLockStatus["WaitingOnChecks"] = 6] = "WaitingOnChecks"; })(ResourceLockStatus = exports.ResourceLockStatus || (exports.ResourceLockStatus = {})); var SecureFileActionFilter; (function (SecureFileActionFilter) { @@ -49860,6 +60123,17 @@ var SecureFileActionFilter; SecureFileActionFilter[SecureFileActionFilter["Manage"] = 2] = "Manage"; SecureFileActionFilter[SecureFileActionFilter["Use"] = 16] = "Use"; })(SecureFileActionFilter = exports.SecureFileActionFilter || (exports.SecureFileActionFilter = {})); +var StageTriggerType; +(function (StageTriggerType) { + /** + * Stage starts automatically + */ + StageTriggerType[StageTriggerType["Automatic"] = 0] = "Automatic"; + /** + * Stage starts on manual run + */ + StageTriggerType[StageTriggerType["Manual"] = 1] = "Manual"; +})(StageTriggerType = exports.StageTriggerType || (exports.StageTriggerType = {})); /** * This is useful in getting a list of deployment targets, filtered by the result of their last job. */ @@ -50072,6 +60346,9 @@ var TaskOrchestrationPlanState; TaskOrchestrationPlanState[TaskOrchestrationPlanState["Completed"] = 4] = "Completed"; TaskOrchestrationPlanState[TaskOrchestrationPlanState["Throttled"] = 8] = "Throttled"; })(TaskOrchestrationPlanState = exports.TaskOrchestrationPlanState || (exports.TaskOrchestrationPlanState = {})); +/** + * The result of an operation tracked by a timeline record. + */ var TaskResult; (function (TaskResult) { TaskResult[TaskResult["Succeeded"] = 0] = "Succeeded"; @@ -50080,7 +60357,12 @@ var TaskResult; TaskResult[TaskResult["Canceled"] = 3] = "Canceled"; TaskResult[TaskResult["Skipped"] = 4] = "Skipped"; TaskResult[TaskResult["Abandoned"] = 5] = "Abandoned"; + TaskResult[TaskResult["ManuallyQueued"] = 6] = "ManuallyQueued"; + TaskResult[TaskResult["DependentOnManualQueue"] = 7] = "DependentOnManualQueue"; })(TaskResult = exports.TaskResult || (exports.TaskResult = {})); +/** + * The state of the timeline record. + */ var TimelineRecordState; (function (TimelineRecordState) { TimelineRecordState[TimelineRecordState["Pending"] = 0] = "Pending"; @@ -50200,7 +60482,10 @@ exports.TypeInfo = { "creating": 2, "deleting": 3, "failed": 4, - "stopped": 5 + "stopped": 5, + "reimaging": 6, + "unhealthyVm": 7, + "unhealthyVmssVm": 8 } }, ElasticNode: {}, @@ -50219,7 +60504,17 @@ exports.TypeInfo = { "saved": 9, "deletingCompute": 10, "deleted": 11, - "lost": 12 + "lost": 12, + "reimagingCompute": 13, + "restartingAgent": 14, + "failedToStartPendingDelete": 15, + "failedToRestartPendingDelete": 16, + "failedVMPendingDelete": 17, + "assignedPendingDelete": 18, + "retryDelete": 19, + "unhealthyVm": 20, + "unhealthyVmPendingDelete": 21, + "pendingReimageCandidate": 22 } }, ElasticPool: {}, @@ -50260,6 +60555,14 @@ exports.TypeInfo = { "kubernetes": 4 } }, + ExclusiveLockType: { + enumValues: { + "runLatest": 0, + "sequential": 1, + "branchRunLatest": 2, + "parallel": 3 + } + }, Issue: {}, IssueType: { enumValues: { @@ -50272,6 +60575,7 @@ exports.TypeInfo = { JobEnvironment: {}, JobRequestMessage: {}, KubernetesResource: {}, + KubernetesResourceCreateParametersNewEndpoint: {}, LogLevel: { enumValues: { "error": 0, @@ -50308,6 +60612,12 @@ exports.TypeInfo = { "deleteVMs": 4 } }, + OrchestrationType: { + enumValues: { + "uniform": 0, + "flexible": 1 + } + }, PackageMetadata: {}, PlanEnvironment: {}, PlanGroupStatus: { @@ -50332,7 +60642,8 @@ exports.TypeInfo = { "finished": 2, "timedOut": 3, "canceled": 4, - "abandoned": 5 + "abandoned": 5, + "waitingOnChecks": 6 } }, ResourceUsage: {}, @@ -50346,12 +60657,19 @@ exports.TypeInfo = { }, SecureFileEvent: {}, ServerTaskRequestMessage: {}, + ServiceEndpoint: {}, ServiceEndpointAuthenticationScheme: {}, ServiceEndpointExecutionData: {}, ServiceEndpointExecutionRecord: {}, ServiceEndpointExecutionRecordsInput: {}, ServiceEndpointRequestResult: {}, ServiceEndpointType: {}, + StageTriggerType: { + enumValues: { + "automatic": 0, + "manual": 1 + } + }, TaskAgent: {}, TaskAgentCloudRequest: {}, TaskAgentCloudType: {}, @@ -50538,11 +60856,14 @@ exports.TypeInfo = { "failed": 2, "canceled": 3, "skipped": 4, - "abandoned": 5 + "abandoned": 5, + "manuallyQueued": 6, + "dependentOnManualQueue": 7 } }, Timeline: {}, TimelineRecord: {}, + TimelineRecordReference: {}, TimelineRecordState: { enumValues: { "pending": 0, @@ -50714,6 +61035,9 @@ exports.TypeInfo.ElasticPool.fields = { offlineSince: { isDate: true, }, + orchestrationType: { + enumType: exports.TypeInfo.OrchestrationType + }, osType: { enumType: exports.TypeInfo.OperatingSystemType }, @@ -50744,6 +61068,9 @@ exports.TypeInfo.ElasticPoolLog.fields = { } }; exports.TypeInfo.ElasticPoolSettings.fields = { + orchestrationType: { + enumType: exports.TypeInfo.OrchestrationType + }, osType: { enumType: exports.TypeInfo.OperatingSystemType } @@ -50817,6 +61144,10 @@ exports.TypeInfo.JobCompletedEvent.fields = { } }; exports.TypeInfo.JobEnvironment.fields = { + endpoints: { + isArray: true, + typeInfo: exports.TypeInfo.ServiceEndpoint + }, mask: { isArray: true, typeInfo: exports.TypeInfo.MaskHint @@ -50824,6 +61155,9 @@ exports.TypeInfo.JobEnvironment.fields = { secureFiles: { isArray: true, typeInfo: exports.TypeInfo.SecureFile + }, + systemConnection: { + typeInfo: exports.TypeInfo.ServiceEndpoint } }; exports.TypeInfo.JobRequestMessage.fields = { @@ -50842,6 +61176,11 @@ exports.TypeInfo.KubernetesResource.fields = { enumType: exports.TypeInfo.EnvironmentResourceType } }; +exports.TypeInfo.KubernetesResourceCreateParametersNewEndpoint.fields = { + endpoint: { + typeInfo: exports.TypeInfo.ServiceEndpoint + } +}; exports.TypeInfo.MaskHint.fields = { type: { enumType: exports.TypeInfo.MaskType @@ -50865,6 +61204,9 @@ exports.TypeInfo.ResourceLockRequest.fields = { finishTime: { isDate: true, }, + lockType: { + enumType: exports.TypeInfo.ExclusiveLockType + }, queueTime: { isDate: true, }, @@ -50900,6 +61242,14 @@ exports.TypeInfo.ServerTaskRequestMessage.fields = { typeInfo: exports.TypeInfo.TaskDefinition } }; +exports.TypeInfo.ServiceEndpoint.fields = { + creationDate: { + isDate: true, + }, + modificationDate: { + isDate: true, + } +}; exports.TypeInfo.ServiceEndpointAuthenticationScheme.fields = { inputDescriptors: { isArray: true, @@ -51308,6 +61658,11 @@ exports.TypeInfo.TimelineRecord.fields = { enumType: exports.TypeInfo.TimelineRecordState } }; +exports.TypeInfo.TimelineRecordReference.fields = { + state: { + enumType: exports.TypeInfo.TimelineRecordState + } +}; exports.TypeInfo.VariableGroup.fields = { createdOn: { isDate: true, @@ -51370,6 +61725,7 @@ exports.TypeInfo.VirtualMachineResourceCreateParameters.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.TestSessionState = exports.TestSessionSource = exports.TestRunSubstate = exports.TestRunState = exports.TestRunPublishContext = exports.TestRunOutcome = exports.TestResultsSettingsType = exports.TestResultsSessionState = exports.TestResultsContextType = exports.TestResultGroupBy = exports.TestPointState = exports.TestOutcome = exports.TestLogType = exports.TestLogStoreOperationType = exports.TestLogStoreEndpointType = exports.TestLogStatusCode = exports.TestLogScope = exports.TestConfigurationState = exports.TCMServiceDataMigrationStatus = exports.SuiteExpand = exports.SessionResult = exports.Service = exports.RunType = exports.ResultObjectType = exports.ResultMetaDataDetails = exports.ResultMetadata = exports.ResultGroupType = exports.ResultDetails = exports.OperationType = exports.Metrics = exports.FlakyDetectionType = exports.CustomTestFieldType = exports.CustomTestFieldScope = exports.CoverageSummaryStatus = exports.CoverageStatus = exports.CoverageQueryFlags = exports.CoverageDetailedSummaryStatus = exports.CloneOperationState = exports.AttachmentType = void 0; const SystemData = __nccwpck_require__(4652); const TfsCoreInterfaces = __nccwpck_require__(3931); /** @@ -51421,6 +61777,104 @@ var CloneOperationState; */ CloneOperationState[CloneOperationState["Succeeded"] = 3] = "Succeeded"; })(CloneOperationState = exports.CloneOperationState || (exports.CloneOperationState = {})); +/** + * Represents status of code coverage summary for a build + */ +var CoverageDetailedSummaryStatus; +(function (CoverageDetailedSummaryStatus) { + /** + * No coverage status + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["None"] = 0] = "None"; + /** + * The summary evaluation is in progress + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["InProgress"] = 1] = "InProgress"; + /** + * The summary evaluation is finalized and won't change + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["Finalized"] = 2] = "Finalized"; + /** + * The summary evaluation is pending + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["Pending"] = 3] = "Pending"; + /** + * Summary evaluation may be ongoing but another merge has been requested. + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["UpdateRequestQueued"] = 4] = "UpdateRequestQueued"; + /** + * No coverage modules found + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["NoModulesFound"] = 5] = "NoModulesFound"; + /** + * Number of Files exceeded + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["NumberOfFilesExceeded"] = 6] = "NumberOfFilesExceeded"; + /** + * TNo Input Files + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["NoInputFiles"] = 7] = "NoInputFiles"; + /** + * Build got cancelled by user + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["BuildCancelled"] = 8] = "BuildCancelled"; + /** + * Coverage Jobs failed + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["FailedJobs"] = 9] = "FailedJobs"; + /** + * Module merge Timeout + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["ModuleMergeJobTimeout"] = 10] = "ModuleMergeJobTimeout"; + /** + * Coverage successfully completed + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["CodeCoverageSuccess"] = 11] = "CodeCoverageSuccess"; + /** + * Invalid Build Configuration + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["InvalidBuildConfiguration"] = 12] = "InvalidBuildConfiguration"; + /** + * Coverage Analyzer Build not found + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["CoverageAnalyzerBuildNotFound"] = 13] = "CoverageAnalyzerBuildNotFound"; + /** + * Failed to requeue the build + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["FailedToRequeue"] = 14] = "FailedToRequeue"; + /** + * Build got Bailed out + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["BuildBailedOut"] = 15] = "BuildBailedOut"; + /** + * No Code coverage configured + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["NoCodeCoverageTask"] = 16] = "NoCodeCoverageTask"; + /** + * CoverageMerge Job failed + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["MergeJobFailed"] = 17] = "MergeJobFailed"; + /** + * CoverageMergeInvoker Job failed + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["MergeInvokerJobFailed"] = 18] = "MergeInvokerJobFailed"; + /** + * CoverageMonitor Job failed + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["MonitorJobFailed"] = 19] = "MonitorJobFailed"; + /** + * CoverageMergeInvoker Job timeout + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["ModuleMergeInvokerJobTimeout"] = 20] = "ModuleMergeInvokerJobTimeout"; + /** + * CoverageMonitor Job timeout + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["MonitorJobTimeout"] = 21] = "MonitorJobTimeout"; + /** + * Invalid Coverage Input file + */ + CoverageDetailedSummaryStatus[CoverageDetailedSummaryStatus["InvalidCoverageInput"] = 22] = "InvalidCoverageInput"; +})(CoverageDetailedSummaryStatus = exports.CoverageDetailedSummaryStatus || (exports.CoverageDetailedSummaryStatus = {})); /** * Used to choose which coverage data is returned by a QueryXXXCoverage() call. */ @@ -51475,21 +61929,58 @@ var CoverageSummaryStatus; */ CoverageSummaryStatus[CoverageSummaryStatus["UpdateRequestQueued"] = 5] = "UpdateRequestQueued"; })(CoverageSummaryStatus = exports.CoverageSummaryStatus || (exports.CoverageSummaryStatus = {})); +/** + * Type of the artifact applicable to CustomTestField. + */ var CustomTestFieldScope; (function (CustomTestFieldScope) { CustomTestFieldScope[CustomTestFieldScope["None"] = 0] = "None"; + /** + * Custom field can be used with TestRun artifact. + */ CustomTestFieldScope[CustomTestFieldScope["TestRun"] = 1] = "TestRun"; + /** + * Custom field can be used with TestResult artifact. + */ CustomTestFieldScope[CustomTestFieldScope["TestResult"] = 2] = "TestResult"; + /** + * Custom test field can be used with either TestRun or TestResult artifact. + */ + CustomTestFieldScope[CustomTestFieldScope["TestRunAndTestResult"] = 3] = "TestRunAndTestResult"; + /** + * Reserved for internal Azure DevOps functionality. Not to be used. + */ CustomTestFieldScope[CustomTestFieldScope["System"] = 4] = "System"; CustomTestFieldScope[CustomTestFieldScope["All"] = 7] = "All"; })(CustomTestFieldScope = exports.CustomTestFieldScope || (exports.CustomTestFieldScope = {})); +/** + * Data type of the custom test field + */ var CustomTestFieldType; (function (CustomTestFieldType) { + /** + * Boolean data type. + */ CustomTestFieldType[CustomTestFieldType["Bit"] = 2] = "Bit"; + /** + * Datetime data type. + */ CustomTestFieldType[CustomTestFieldType["DateTime"] = 4] = "DateTime"; + /** + * Integer data type. + */ CustomTestFieldType[CustomTestFieldType["Int"] = 8] = "Int"; + /** + * Floating integer data type. + */ CustomTestFieldType[CustomTestFieldType["Float"] = 6] = "Float"; + /** + * String data type. + */ CustomTestFieldType[CustomTestFieldType["String"] = 12] = "String"; + /** + * Unique identifier data type. + */ CustomTestFieldType[CustomTestFieldType["Guid"] = 14] = "Guid"; })(CustomTestFieldType = exports.CustomTestFieldType || (exports.CustomTestFieldType = {})); var FlakyDetectionType; @@ -51658,6 +62149,25 @@ var Service; Service[Service["Tcm"] = 1] = "Tcm"; Service[Service["Tfs"] = 2] = "Tfs"; })(Service = exports.Service || (exports.Service = {})); +var SessionResult; +(function (SessionResult) { + /** + * Default + */ + SessionResult[SessionResult["None"] = 0] = "None"; + /** + * Session result with Passed + */ + SessionResult[SessionResult["Passed"] = 1] = "Passed"; + /** + * Session result with Failed + */ + SessionResult[SessionResult["Failed"] = 2] = "Failed"; + /** + * Session result still Pending + */ + SessionResult[SessionResult["Pending"] = 3] = "Pending"; +})(SessionResult = exports.SessionResult || (exports.SessionResult = {})); /** * Option to get details in response */ @@ -51854,6 +62364,10 @@ var TestLogType; * Subresult Attachment */ TestLogType[TestLogType["System"] = 5] = "System"; + /** + * merged Coverage file + */ + TestLogType[TestLogType["MergedCoverageFile"] = 6] = "MergedCoverageFile"; })(TestLogType = exports.TestLogType || (exports.TestLogType = {})); /** * Valid TestOutcome values. @@ -51966,6 +62480,29 @@ var TestResultsContextType; TestResultsContextType[TestResultsContextType["Release"] = 2] = "Release"; TestResultsContextType[TestResultsContextType["Pipeline"] = 3] = "Pipeline"; })(TestResultsContextType = exports.TestResultsContextType || (exports.TestResultsContextType = {})); +var TestResultsSessionState; +(function (TestResultsSessionState) { + /** + * Default + */ + TestResultsSessionState[TestResultsSessionState["None"] = 0] = "None"; + /** + * Session state with Running + */ + TestResultsSessionState[TestResultsSessionState["Running"] = 1] = "Running"; + /** + * Session state with Completed + */ + TestResultsSessionState[TestResultsSessionState["Completed"] = 2] = "Completed"; + /** + * Session state with Waiting + */ + TestResultsSessionState[TestResultsSessionState["Waiting"] = 3] = "Waiting"; + /** + * Session state with Cancelled + */ + TestResultsSessionState[TestResultsSessionState["Cancelled"] = 4] = "Cancelled"; +})(TestResultsSessionState = exports.TestResultsSessionState || (exports.TestResultsSessionState = {})); var TestResultsSettingsType; (function (TestResultsSettingsType) { /** @@ -52201,6 +62738,33 @@ exports.TypeInfo = { }, CodeCoverageSummary: {}, Coverage2: {}, + CoverageDetailedSummaryStatus: { + enumValues: { + "none": 0, + "inProgress": 1, + "finalized": 2, + "pending": 3, + "updateRequestQueued": 4, + "noModulesFound": 5, + "numberOfFilesExceeded": 6, + "noInputFiles": 7, + "buildCancelled": 8, + "failedJobs": 9, + "moduleMergeJobTimeout": 10, + "codeCoverageSuccess": 11, + "invalidBuildConfiguration": 12, + "coverageAnalyzerBuildNotFound": 13, + "failedToRequeue": 14, + "buildBailedOut": 15, + "noCodeCoverageTask": 16, + "mergeJobFailed": 17, + "mergeInvokerJobFailed": 18, + "monitorJobFailed": 19, + "moduleMergeInvokerJobTimeout": 20, + "monitorJobTimeout": 21, + "invalidCoverageInput": 22 + } + }, CoverageQueryFlags: { enumValues: { "modules": 1, @@ -52234,6 +62798,7 @@ exports.TypeInfo = { "none": 0, "testRun": 1, "testResult": 2, + "testRunAndTestResult": 3, "system": 4, "all": 7 } @@ -52265,6 +62830,7 @@ exports.TypeInfo = { LegacyTestCaseResult: {}, LegacyTestRun: {}, LegacyTestSettings: {}, + Machine: {}, Metrics: { enumValues: { "all": 1, @@ -52354,6 +62920,16 @@ exports.TypeInfo = { "tfs": 2 } }, + SessionEnvironmentAndMachine: {}, + SessionResult: { + enumValues: { + "none": 0, + "passed": 1, + "failed": 2, + "pending": 3 + } + }, + SourceViewBuildCoverage: {}, SuiteExpand: { enumValues: { "children": 1, @@ -52419,6 +62995,7 @@ exports.TypeInfo = { "storageCapacityExceeded": 16 } }, + TestLogStoreAttachment: {}, TestLogStoreEndpointDetails: {}, TestLogStoreEndpointType: { enumValues: { @@ -52439,12 +63016,14 @@ exports.TypeInfo = { "codeCoverage": 2, "testImpact": 3, "intermediate": 4, - "system": 5 + "system": 5, + "mergedCoverageFile": 6 } }, TestMessageLogDetails: {}, TestMessageLogEntry: {}, TestMessageLogEntry2: {}, + TestMethod: {}, TestOutcome: { enumValues: { "unspecified": 0, @@ -52511,6 +63090,16 @@ exports.TypeInfo = { TestResultsDetailsForGroup: {}, TestResultsEx2: {}, TestResultsQuery: {}, + TestResultsSession: {}, + TestResultsSessionState: { + enumValues: { + "none": 0, + "running": 1, + "completed": 2, + "waiting": 3, + "cancelled": 4 + } + }, TestResultsSettings: {}, TestResultsSettingsType: { enumValues: { @@ -52599,6 +63188,8 @@ exports.TypeInfo = { TestSubResult: {}, TestSuite: {}, TestSummaryForWorkItem: {}, + TestToWorkItemLinks: {}, + Timeline: {}, UpdatedProperties: {}, UpdateTestRunRequest: {}, UpdateTestRunResponse: {}, @@ -52716,6 +63307,9 @@ exports.TypeInfo.CloneOperationInformation.fields = { } }; exports.TypeInfo.CodeCoverageSummary.fields = { + coverageDetailedSummaryStatus: { + enumType: exports.TypeInfo.CoverageDetailedSummaryStatus + }, status: { enumType: exports.TypeInfo.CoverageSummaryStatus } @@ -52890,6 +63484,12 @@ exports.TypeInfo.LegacyTestSettings.fields = { isDate: true, } }; +exports.TypeInfo.Machine.fields = { + timeline: { + isArray: true, + typeInfo: exports.TypeInfo.Timeline + } +}; exports.TypeInfo.PipelineTestMetrics.fields = { resultSummary: { typeInfo: exports.TypeInfo.ResultSummary @@ -53060,6 +63660,17 @@ exports.TypeInfo.RunUpdateModel.fields = { enumType: exports.TypeInfo.TestRunSubstate } }; +exports.TypeInfo.SessionEnvironmentAndMachine.fields = { + machines: { + isArray: true, + typeInfo: exports.TypeInfo.Machine + } +}; +exports.TypeInfo.SourceViewBuildCoverage.fields = { + configuration: { + typeInfo: exports.TypeInfo.BuildConfiguration + } +}; exports.TypeInfo.TestActionResult.fields = { creationDate: { isDate: true, @@ -53225,6 +63836,14 @@ exports.TypeInfo.TestLogStatus.fields = { enumType: exports.TypeInfo.TestLogStatusCode } }; +exports.TypeInfo.TestLogStoreAttachment.fields = { + attachmentType: { + enumType: exports.TypeInfo.AttachmentType + }, + createdDate: { + isDate: true, + } +}; exports.TypeInfo.TestLogStoreEndpointDetails.fields = { endpointType: { enumType: exports.TypeInfo.TestLogStoreEndpointType @@ -53248,6 +63867,11 @@ exports.TypeInfo.TestMessageLogEntry2.fields = { isDate: true, } }; +exports.TypeInfo.TestMethod.fields = { + testResult: { + typeInfo: exports.TypeInfo.TestCaseResult + } +}; exports.TypeInfo.TestParameter2.fields = { creationDate: { isDate: true, @@ -53424,6 +64048,24 @@ exports.TypeInfo.TestResultsQuery.fields = { typeInfo: exports.TypeInfo.ResultsFilter } }; +exports.TypeInfo.TestResultsSession.fields = { + endTimeUTC: { + isDate: true, + }, + result: { + enumType: exports.TypeInfo.SessionResult + }, + startTimeUTC: { + isDate: true, + }, + state: { + enumType: exports.TypeInfo.TestResultsSessionState + }, + timeline: { + isArray: true, + typeInfo: exports.TypeInfo.Timeline + } +}; exports.TypeInfo.TestResultsSettings.fields = { flakySettings: { typeInfo: exports.TypeInfo.FlakySettings @@ -53624,6 +64266,16 @@ exports.TypeInfo.TestSummaryForWorkItem.fields = { typeInfo: exports.TypeInfo.AggregatedDataForResultTrend } }; +exports.TypeInfo.TestToWorkItemLinks.fields = { + test: { + typeInfo: exports.TypeInfo.TestMethod + } +}; +exports.TypeInfo.Timeline.fields = { + timestampUTC: { + isDate: true, + } +}; exports.TypeInfo.UpdatedProperties.fields = { lastUpdated: { isDate: true, @@ -53646,6 +64298,747 @@ exports.TypeInfo.UpdateTestRunResponse.fields = { exports.TypeInfo.WorkItemToTestLinks.fields = { executedIn: { enumType: exports.TypeInfo.Service + }, + tests: { + isArray: true, + typeInfo: exports.TypeInfo.TestMethod + } +}; + + +/***/ }), + +/***/ 8969: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +/* + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.UserFriendlyTestOutcome = exports.TestSuiteType = exports.TestPlansLibraryWorkItemFilterMode = exports.TestPlansLibraryQuery = exports.TestEntityTypes = exports.SuiteExpand = exports.SuiteEntryTypes = exports.ResultState = exports.PointState = exports.Outcome = exports.LibraryTestCasesDataReturnCode = exports.LastResolutionState = exports.FailureType = exports.ExcludeFlags = void 0; +const TFS_TestManagement_Contracts = __nccwpck_require__(3047); +const TfsCoreInterfaces = __nccwpck_require__(3931); +/** + * Exclude Flags for suite test case object. Exclude Flags exclude various objects from payload depending on the value passed + */ +var ExcludeFlags; +(function (ExcludeFlags) { + /** + * To exclude nothing + */ + ExcludeFlags[ExcludeFlags["None"] = 0] = "None"; + /** + * To exclude point assignments, pass exclude = 1 + */ + ExcludeFlags[ExcludeFlags["PointAssignments"] = 1] = "PointAssignments"; + /** + * To exclude extra information (links, test plan, test suite), pass exclude = 2 + */ + ExcludeFlags[ExcludeFlags["ExtraInformation"] = 2] = "ExtraInformation"; +})(ExcludeFlags = exports.ExcludeFlags || (exports.ExcludeFlags = {})); +var FailureType; +(function (FailureType) { + FailureType[FailureType["None"] = 0] = "None"; + FailureType[FailureType["Regression"] = 1] = "Regression"; + FailureType[FailureType["New_Issue"] = 2] = "New_Issue"; + FailureType[FailureType["Known_Issue"] = 3] = "Known_Issue"; + FailureType[FailureType["Unknown"] = 4] = "Unknown"; + FailureType[FailureType["Null_Value"] = 5] = "Null_Value"; + FailureType[FailureType["MaxValue"] = 5] = "MaxValue"; +})(FailureType = exports.FailureType || (exports.FailureType = {})); +var LastResolutionState; +(function (LastResolutionState) { + LastResolutionState[LastResolutionState["None"] = 0] = "None"; + LastResolutionState[LastResolutionState["NeedsInvestigation"] = 1] = "NeedsInvestigation"; + LastResolutionState[LastResolutionState["TestIssue"] = 2] = "TestIssue"; + LastResolutionState[LastResolutionState["ProductIssue"] = 3] = "ProductIssue"; + LastResolutionState[LastResolutionState["ConfigurationIssue"] = 4] = "ConfigurationIssue"; + LastResolutionState[LastResolutionState["NullValue"] = 5] = "NullValue"; + LastResolutionState[LastResolutionState["MaxValue"] = 5] = "MaxValue"; +})(LastResolutionState = exports.LastResolutionState || (exports.LastResolutionState = {})); +/** + * Enum representing the return code of data provider. + */ +var LibraryTestCasesDataReturnCode; +(function (LibraryTestCasesDataReturnCode) { + LibraryTestCasesDataReturnCode[LibraryTestCasesDataReturnCode["Success"] = 0] = "Success"; + LibraryTestCasesDataReturnCode[LibraryTestCasesDataReturnCode["Error"] = 1] = "Error"; +})(LibraryTestCasesDataReturnCode = exports.LibraryTestCasesDataReturnCode || (exports.LibraryTestCasesDataReturnCode = {})); +var Outcome; +(function (Outcome) { + /** + * Only used during an update to preserve the existing value. + */ + Outcome[Outcome["Unspecified"] = 0] = "Unspecified"; + /** + * Test has not been completed, or the test type does not report pass/failure. + */ + Outcome[Outcome["None"] = 1] = "None"; + /** + * Test was executed w/o any issues. + */ + Outcome[Outcome["Passed"] = 2] = "Passed"; + /** + * Test was executed, but there were issues. Issues may involve exceptions or failed assertions. + */ + Outcome[Outcome["Failed"] = 3] = "Failed"; + /** + * Test has completed, but we can't say if it passed or failed. May be used for aborted tests... + */ + Outcome[Outcome["Inconclusive"] = 4] = "Inconclusive"; + /** + * The test timed out + */ + Outcome[Outcome["Timeout"] = 5] = "Timeout"; + /** + * Test was aborted. This was not caused by a user gesture, but rather by a framework decision. + */ + Outcome[Outcome["Aborted"] = 6] = "Aborted"; + /** + * Test had it chance for been executed but was not, as ITestElement.IsRunnable == false. + */ + Outcome[Outcome["Blocked"] = 7] = "Blocked"; + /** + * Test was not executed. This was caused by a user gesture - e.g. user hit stop button. + */ + Outcome[Outcome["NotExecuted"] = 8] = "NotExecuted"; + /** + * To be used by Run level results. This is not a failure. + */ + Outcome[Outcome["Warning"] = 9] = "Warning"; + /** + * There was a system error while we were trying to execute a test. + */ + Outcome[Outcome["Error"] = 10] = "Error"; + /** + * Test is Not Applicable for execution. + */ + Outcome[Outcome["NotApplicable"] = 11] = "NotApplicable"; + /** + * Test is paused. + */ + Outcome[Outcome["Paused"] = 12] = "Paused"; + /** + * Test is currently executing. Added this for TCM charts + */ + Outcome[Outcome["InProgress"] = 13] = "InProgress"; + /** + * Test is not impacted. Added fot TIA. + */ + Outcome[Outcome["NotImpacted"] = 14] = "NotImpacted"; + Outcome[Outcome["MaxValue"] = 14] = "MaxValue"; +})(Outcome = exports.Outcome || (exports.Outcome = {})); +var PointState; +(function (PointState) { + /** + * Default + */ + PointState[PointState["None"] = 0] = "None"; + /** + * The test point needs to be executed in order for the test pass to be considered complete. Either the test has not been run before or the previous run failed. + */ + PointState[PointState["Ready"] = 1] = "Ready"; + /** + * The test has passed successfully and does not need to be re-run for the test pass to be considered complete. + */ + PointState[PointState["Completed"] = 2] = "Completed"; + /** + * The test point needs to be executed but is not able to. + */ + PointState[PointState["NotReady"] = 3] = "NotReady"; + /** + * The test is being executed. + */ + PointState[PointState["InProgress"] = 4] = "InProgress"; + PointState[PointState["MaxValue"] = 4] = "MaxValue"; +})(PointState = exports.PointState || (exports.PointState = {})); +var ResultState; +(function (ResultState) { + /** + * Only used during an update to preserve the existing value. + */ + ResultState[ResultState["Unspecified"] = 0] = "Unspecified"; + /** + * Test is in the execution queue, was not started yet. + */ + ResultState[ResultState["Pending"] = 1] = "Pending"; + /** + * Test has been queued. This is applicable when a test case is queued for execution + */ + ResultState[ResultState["Queued"] = 2] = "Queued"; + /** + * Test is currently executing. + */ + ResultState[ResultState["InProgress"] = 3] = "InProgress"; + /** + * Test has been paused. This is applicable when a test case is paused by the user (For e.g. Manual Tester can pause the execution of the manual test case) + */ + ResultState[ResultState["Paused"] = 4] = "Paused"; + /** + * Test has completed, but there is no quantitative measure of completeness. This may apply to load tests. + */ + ResultState[ResultState["Completed"] = 5] = "Completed"; + ResultState[ResultState["MaxValue"] = 5] = "MaxValue"; +})(ResultState = exports.ResultState || (exports.ResultState = {})); +var SuiteEntryTypes; +(function (SuiteEntryTypes) { + /** + * Test Case + */ + SuiteEntryTypes[SuiteEntryTypes["TestCase"] = 0] = "TestCase"; + /** + * Child Suite + */ + SuiteEntryTypes[SuiteEntryTypes["Suite"] = 1] = "Suite"; +})(SuiteEntryTypes = exports.SuiteEntryTypes || (exports.SuiteEntryTypes = {})); +/** + * Option to get details in response + */ +var SuiteExpand; +(function (SuiteExpand) { + /** + * Dont include any of the expansions in output. + */ + SuiteExpand[SuiteExpand["None"] = 0] = "None"; + /** + * Include children in response. + */ + SuiteExpand[SuiteExpand["Children"] = 1] = "Children"; + /** + * Include default testers in response. + */ + SuiteExpand[SuiteExpand["DefaultTesters"] = 2] = "DefaultTesters"; +})(SuiteExpand = exports.SuiteExpand || (exports.SuiteExpand = {})); +var TestEntityTypes; +(function (TestEntityTypes) { + TestEntityTypes[TestEntityTypes["TestCase"] = 0] = "TestCase"; + TestEntityTypes[TestEntityTypes["TestPoint"] = 1] = "TestPoint"; +})(TestEntityTypes = exports.TestEntityTypes || (exports.TestEntityTypes = {})); +/** + * Enum used to define the queries used in Test Plans Library. + */ +var TestPlansLibraryQuery; +(function (TestPlansLibraryQuery) { + TestPlansLibraryQuery[TestPlansLibraryQuery["None"] = 0] = "None"; + TestPlansLibraryQuery[TestPlansLibraryQuery["AllTestCases"] = 1] = "AllTestCases"; + TestPlansLibraryQuery[TestPlansLibraryQuery["TestCasesWithActiveBugs"] = 2] = "TestCasesWithActiveBugs"; + TestPlansLibraryQuery[TestPlansLibraryQuery["TestCasesNotLinkedToRequirements"] = 3] = "TestCasesNotLinkedToRequirements"; + TestPlansLibraryQuery[TestPlansLibraryQuery["TestCasesLinkedToRequirements"] = 4] = "TestCasesLinkedToRequirements"; + TestPlansLibraryQuery[TestPlansLibraryQuery["AllSharedSteps"] = 11] = "AllSharedSteps"; + TestPlansLibraryQuery[TestPlansLibraryQuery["SharedStepsNotLinkedToRequirement"] = 12] = "SharedStepsNotLinkedToRequirement"; +})(TestPlansLibraryQuery = exports.TestPlansLibraryQuery || (exports.TestPlansLibraryQuery = {})); +var TestPlansLibraryWorkItemFilterMode; +(function (TestPlansLibraryWorkItemFilterMode) { + /** + * Default. Have the field values separated by an OR clause. + */ + TestPlansLibraryWorkItemFilterMode[TestPlansLibraryWorkItemFilterMode["Or"] = 0] = "Or"; + /** + * Have the field values separated by an AND clause. + */ + TestPlansLibraryWorkItemFilterMode[TestPlansLibraryWorkItemFilterMode["And"] = 1] = "And"; +})(TestPlansLibraryWorkItemFilterMode = exports.TestPlansLibraryWorkItemFilterMode || (exports.TestPlansLibraryWorkItemFilterMode = {})); +/** + * Type of TestSuite + */ +var TestSuiteType; +(function (TestSuiteType) { + /** + * Default suite type + */ + TestSuiteType[TestSuiteType["None"] = 0] = "None"; + /** + * Query Based test Suite + */ + TestSuiteType[TestSuiteType["DynamicTestSuite"] = 1] = "DynamicTestSuite"; + /** + * Static Test Suite + */ + TestSuiteType[TestSuiteType["StaticTestSuite"] = 2] = "StaticTestSuite"; + /** + * Requirement based Test Suite + */ + TestSuiteType[TestSuiteType["RequirementTestSuite"] = 3] = "RequirementTestSuite"; +})(TestSuiteType = exports.TestSuiteType || (exports.TestSuiteType = {})); +var UserFriendlyTestOutcome; +(function (UserFriendlyTestOutcome) { + UserFriendlyTestOutcome[UserFriendlyTestOutcome["InProgress"] = 0] = "InProgress"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Blocked"] = 1] = "Blocked"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Failed"] = 2] = "Failed"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Passed"] = 3] = "Passed"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Ready"] = 4] = "Ready"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["NotApplicable"] = 5] = "NotApplicable"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Paused"] = 6] = "Paused"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Timeout"] = 7] = "Timeout"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Warning"] = 8] = "Warning"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Error"] = 9] = "Error"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["NotExecuted"] = 10] = "NotExecuted"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Inconclusive"] = 11] = "Inconclusive"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Aborted"] = 12] = "Aborted"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["None"] = 13] = "None"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["NotImpacted"] = 14] = "NotImpacted"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["Unspecified"] = 15] = "Unspecified"; + UserFriendlyTestOutcome[UserFriendlyTestOutcome["MaxValue"] = 15] = "MaxValue"; +})(UserFriendlyTestOutcome = exports.UserFriendlyTestOutcome || (exports.UserFriendlyTestOutcome = {})); +exports.TypeInfo = { + CloneOperationCommonResponse: {}, + CloneTestCaseOperationInformation: {}, + CloneTestPlanOperationInformation: {}, + CloneTestPlanParams: {}, + CloneTestSuiteOperationInformation: {}, + DestinationTestPlanCloneParams: {}, + ExcludeFlags: { + enumValues: { + "none": 0, + "pointAssignments": 1, + "extraInformation": 2 + } + }, + FailureType: { + enumValues: { + "none": 0, + "regression": 1, + "new_Issue": 2, + "known_Issue": 3, + "unknown": 4, + "null_Value": 5, + "maxValue": 5 + } + }, + LastResolutionState: { + enumValues: { + "none": 0, + "needsInvestigation": 1, + "testIssue": 2, + "productIssue": 3, + "configurationIssue": 4, + "nullValue": 5, + "maxValue": 5 + } + }, + LibraryTestCasesDataReturnCode: { + enumValues: { + "success": 0, + "error": 1 + } + }, + LibraryWorkItemsData: {}, + LibraryWorkItemsDataProviderRequest: {}, + Outcome: { + enumValues: { + "unspecified": 0, + "none": 1, + "passed": 2, + "failed": 3, + "inconclusive": 4, + "timeout": 5, + "aborted": 6, + "blocked": 7, + "notExecuted": 8, + "warning": 9, + "error": 10, + "notApplicable": 11, + "paused": 12, + "inProgress": 13, + "notImpacted": 14, + "maxValue": 14 + } + }, + PointState: { + enumValues: { + "none": 0, + "ready": 1, + "completed": 2, + "notReady": 3, + "inProgress": 4, + "maxValue": 4 + } + }, + Results: {}, + ResultState: { + enumValues: { + "unspecified": 0, + "pending": 1, + "queued": 2, + "inProgress": 3, + "paused": 4, + "completed": 5, + "maxValue": 5 + } + }, + SourceTestplanResponse: {}, + SourceTestSuiteResponse: {}, + SuiteEntry: {}, + SuiteEntryTypes: { + enumValues: { + "testCase": 0, + "suite": 1 + } + }, + SuiteEntryUpdateParams: {}, + SuiteExpand: { + enumValues: { + "none": 0, + "children": 1, + "defaultTesters": 2 + } + }, + TestCase: {}, + TestCaseAssociatedResult: {}, + TestCaseAssociatedResultExtended: {}, + TestCaseResultsData: {}, + TestCaseResultsDataExtended: {}, + TestConfiguration: {}, + TestConfigurationCreateUpdateParameters: {}, + TestEntityTypes: { + enumValues: { + "testCase": 0, + "testPoint": 1 + } + }, + TestPlan: {}, + TestPlanCreateParams: {}, + TestPlanDetailedReference: {}, + TestPlansHubRefreshData: {}, + TestPlansLibraryQuery: { + enumValues: { + "none": 0, + "allTestCases": 1, + "testCasesWithActiveBugs": 2, + "testCasesNotLinkedToRequirements": 3, + "testCasesLinkedToRequirements": 4, + "allSharedSteps": 11, + "sharedStepsNotLinkedToRequirement": 12 + } + }, + TestPlansLibraryWorkItemFilter: {}, + TestPlansLibraryWorkItemFilterMode: { + enumValues: { + "or": 0, + "and": 1 + } + }, + TestPlanUpdateParams: {}, + TestPoint: {}, + TestPointResults: {}, + TestPointUpdateParams: {}, + TestSuite: {}, + TestSuiteCreateParams: {}, + TestSuiteReferenceWithProject: {}, + TestSuiteType: { + enumValues: { + "none": 0, + "dynamicTestSuite": 1, + "staticTestSuite": 2, + "requirementTestSuite": 3 + } + }, + TestVariable: {}, + UserFriendlyTestOutcome: { + enumValues: { + "inProgress": 0, + "blocked": 1, + "failed": 2, + "passed": 3, + "ready": 4, + "notApplicable": 5, + "paused": 6, + "timeout": 7, + "warning": 8, + "error": 9, + "notExecuted": 10, + "inconclusive": 11, + "aborted": 12, + "none": 13, + "notImpacted": 14, + "unspecified": 15, + "maxValue": 15 + } + }, +}; +exports.TypeInfo.CloneOperationCommonResponse.fields = { + completionDate: { + isDate: true, + }, + creationDate: { + isDate: true, + }, + state: { + enumType: TFS_TestManagement_Contracts.TypeInfo.CloneOperationState + } +}; +exports.TypeInfo.CloneTestCaseOperationInformation.fields = { + cloneOperationResponse: { + typeInfo: exports.TypeInfo.CloneOperationCommonResponse + }, + destinationTestSuite: { + typeInfo: exports.TypeInfo.TestSuiteReferenceWithProject + }, + sourceTestSuite: { + typeInfo: exports.TypeInfo.SourceTestSuiteResponse + } +}; +exports.TypeInfo.CloneTestPlanOperationInformation.fields = { + cloneOperationResponse: { + typeInfo: exports.TypeInfo.CloneOperationCommonResponse + }, + destinationTestPlan: { + typeInfo: exports.TypeInfo.TestPlan + }, + sourceTestPlan: { + typeInfo: exports.TypeInfo.SourceTestplanResponse + } +}; +exports.TypeInfo.CloneTestPlanParams.fields = { + destinationTestPlan: { + typeInfo: exports.TypeInfo.DestinationTestPlanCloneParams + } +}; +exports.TypeInfo.CloneTestSuiteOperationInformation.fields = { + clonedTestSuite: { + typeInfo: exports.TypeInfo.TestSuiteReferenceWithProject + }, + cloneOperationResponse: { + typeInfo: exports.TypeInfo.CloneOperationCommonResponse + }, + destinationTestSuite: { + typeInfo: exports.TypeInfo.TestSuiteReferenceWithProject + }, + sourceTestSuite: { + typeInfo: exports.TypeInfo.TestSuiteReferenceWithProject + } +}; +exports.TypeInfo.DestinationTestPlanCloneParams.fields = { + endDate: { + isDate: true, + }, + startDate: { + isDate: true, + } +}; +exports.TypeInfo.LibraryWorkItemsData.fields = { + returnCode: { + enumType: exports.TypeInfo.LibraryTestCasesDataReturnCode + } +}; +exports.TypeInfo.LibraryWorkItemsDataProviderRequest.fields = { + filterValues: { + isArray: true, + typeInfo: exports.TypeInfo.TestPlansLibraryWorkItemFilter + }, + libraryQueryType: { + enumType: exports.TypeInfo.TestPlansLibraryQuery + } +}; +exports.TypeInfo.Results.fields = { + outcome: { + enumType: exports.TypeInfo.Outcome + } +}; +exports.TypeInfo.SourceTestplanResponse.fields = { + project: { + typeInfo: TfsCoreInterfaces.TypeInfo.TeamProjectReference + } +}; +exports.TypeInfo.SourceTestSuiteResponse.fields = { + project: { + typeInfo: TfsCoreInterfaces.TypeInfo.TeamProjectReference + } +}; +exports.TypeInfo.SuiteEntry.fields = { + suiteEntryType: { + enumType: exports.TypeInfo.SuiteEntryTypes + } +}; +exports.TypeInfo.SuiteEntryUpdateParams.fields = { + suiteEntryType: { + enumType: exports.TypeInfo.SuiteEntryTypes + } +}; +exports.TypeInfo.TestCase.fields = { + project: { + typeInfo: TfsCoreInterfaces.TypeInfo.TeamProjectReference + } +}; +exports.TypeInfo.TestCaseAssociatedResult.fields = { + completedDate: { + isDate: true, + }, + outcome: { + enumType: exports.TypeInfo.UserFriendlyTestOutcome + } +}; +exports.TypeInfo.TestCaseAssociatedResultExtended.fields = { + completedDate: { + isDate: true, + }, + outcome: { + enumType: exports.TypeInfo.UserFriendlyTestOutcome + } +}; +exports.TypeInfo.TestCaseResultsData.fields = { + results: { + isArray: true, + typeInfo: exports.TypeInfo.TestCaseAssociatedResult + } +}; +exports.TypeInfo.TestCaseResultsDataExtended.fields = { + results: { + isArray: true, + typeInfo: exports.TypeInfo.TestCaseAssociatedResultExtended + } +}; +exports.TypeInfo.TestConfiguration.fields = { + project: { + typeInfo: TfsCoreInterfaces.TypeInfo.TeamProjectReference + }, + state: { + enumType: TFS_TestManagement_Contracts.TypeInfo.TestConfigurationState + } +}; +exports.TypeInfo.TestConfigurationCreateUpdateParameters.fields = { + state: { + enumType: TFS_TestManagement_Contracts.TypeInfo.TestConfigurationState + } +}; +exports.TypeInfo.TestPlan.fields = { + endDate: { + isDate: true, + }, + project: { + typeInfo: TfsCoreInterfaces.TypeInfo.TeamProjectReference + }, + startDate: { + isDate: true, + }, + updatedDate: { + isDate: true, + } +}; +exports.TypeInfo.TestPlanCreateParams.fields = { + endDate: { + isDate: true, + }, + startDate: { + isDate: true, + } +}; +exports.TypeInfo.TestPlanDetailedReference.fields = { + endDate: { + isDate: true, + }, + startDate: { + isDate: true, + } +}; +exports.TypeInfo.TestPlansHubRefreshData.fields = { + testCases: { + isArray: true, + typeInfo: exports.TypeInfo.TestCase + }, + testPlan: { + typeInfo: exports.TypeInfo.TestPlanDetailedReference + }, + testPoints: { + isArray: true, + typeInfo: exports.TypeInfo.TestPoint + }, + testSuites: { + isArray: true, + typeInfo: exports.TypeInfo.TestSuite + } +}; +exports.TypeInfo.TestPlansLibraryWorkItemFilter.fields = { + filterMode: { + enumType: exports.TypeInfo.TestPlansLibraryWorkItemFilterMode + } +}; +exports.TypeInfo.TestPlanUpdateParams.fields = { + endDate: { + isDate: true, + }, + startDate: { + isDate: true, + } +}; +exports.TypeInfo.TestPoint.fields = { + lastResetToActive: { + isDate: true, + }, + lastUpdatedDate: { + isDate: true, + }, + project: { + typeInfo: TfsCoreInterfaces.TypeInfo.TeamProjectReference + }, + results: { + typeInfo: exports.TypeInfo.TestPointResults + } +}; +exports.TypeInfo.TestPointResults.fields = { + failureType: { + enumType: exports.TypeInfo.FailureType + }, + lastResolutionState: { + enumType: exports.TypeInfo.LastResolutionState + }, + lastResultDetails: { + typeInfo: TFS_TestManagement_Contracts.TypeInfo.LastResultDetails + }, + lastResultState: { + enumType: exports.TypeInfo.ResultState + }, + outcome: { + enumType: exports.TypeInfo.Outcome + }, + state: { + enumType: exports.TypeInfo.PointState + } +}; +exports.TypeInfo.TestPointUpdateParams.fields = { + results: { + typeInfo: exports.TypeInfo.Results + } +}; +exports.TypeInfo.TestSuite.fields = { + children: { + isArray: true, + typeInfo: exports.TypeInfo.TestSuite + }, + lastPopulatedDate: { + isDate: true, + }, + lastUpdatedDate: { + isDate: true, + }, + project: { + typeInfo: TfsCoreInterfaces.TypeInfo.TeamProjectReference + }, + suiteType: { + enumType: exports.TypeInfo.TestSuiteType + } +}; +exports.TypeInfo.TestSuiteCreateParams.fields = { + suiteType: { + enumType: exports.TypeInfo.TestSuiteType + } +}; +exports.TypeInfo.TestSuiteReferenceWithProject.fields = { + project: { + typeInfo: TfsCoreInterfaces.TypeInfo.TeamProjectReference + } +}; +exports.TypeInfo.TestVariable.fields = { + project: { + typeInfo: TfsCoreInterfaces.TypeInfo.TeamProjectReference } }; @@ -53667,6 +65060,7 @@ exports.TypeInfo.WorkItemToTestLinks.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.VersionControlRecursionType = exports.VersionControlChangeType = exports.TfvcVersionType = exports.TfvcVersionOption = exports.ItemContentType = void 0; const TfsCoreInterfaces = __nccwpck_require__(3931); var ItemContentType; (function (ItemContentType) { @@ -53847,6 +65241,9 @@ exports.TypeInfo.Change.fields = { } }; exports.TypeInfo.GitRepository.fields = { + creationDate: { + isDate: true, + }, parentRepository: { typeInfo: exports.TypeInfo.GitRepositoryRef }, @@ -53985,6 +65382,7 @@ exports.TypeInfo.VersionControlProjectInfo.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.WikiType = void 0; const GitInterfaces = __nccwpck_require__(9803); /** * Wiki types. @@ -54084,6 +65482,7 @@ exports.TypeInfo.WikiV2.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.TimelineTeamStatusCode = exports.TimelineIterationStatusCode = exports.TimelineCriteriaStatusCode = exports.TimeFrame = exports.PlanUserPermissions = exports.PlanType = exports.IdentityDisplayFormat = exports.FieldType = exports.BugsBehavior = exports.BoardColumnType = exports.BoardBadgeColumnOptions = exports.BacklogType = void 0; const SystemInterfaces = __nccwpck_require__(6790); /** * Definition of the type of backlog level @@ -54501,6 +65900,9 @@ exports.TypeInfo.Plan.fields = { createdDate: { isDate: true, }, + lastAccessed: { + isDate: true, + }, modifiedDate: { isDate: true, }, @@ -54648,6 +66050,7 @@ exports.TypeInfo.UpdatePlan.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.WorkItemTypeFieldsExpandLevel = exports.WorkItemRecentActivityType = exports.WorkItemExpand = exports.WorkItemErrorPolicy = exports.TreeStructureGroup = exports.TreeNodeStructureType = exports.TemplateType = exports.ReportingRevisionsExpand = exports.QueryType = exports.QueryResultType = exports.QueryRecursionOption = exports.QueryOption = exports.QueryExpand = exports.QueryErrorPolicy = exports.ProvisioningActionType = exports.LogicalOperation = exports.LinkQueryMode = exports.GetFieldsExpand = exports.FieldUsage = exports.FieldType = exports.CommentSortOrder = exports.CommentReactionType = exports.CommentFormat = exports.CommentExpandOptions = exports.ClassificationNodesErrorPolicy = void 0; /** * Flag to control error policy in a batch classification nodes get request. */ @@ -54676,6 +66079,14 @@ var CommentExpandOptions; CommentExpandOptions[CommentExpandOptions["RenderedTextOnly"] = 16] = "RenderedTextOnly"; CommentExpandOptions[CommentExpandOptions["All"] = -17] = "All"; })(CommentExpandOptions = exports.CommentExpandOptions || (exports.CommentExpandOptions = {})); +/** + * Represents the possible types for the comment format. Should be in sync with WorkItemCommentFormat.cs + */ +var CommentFormat; +(function (CommentFormat) { + CommentFormat[CommentFormat["Markdown"] = 0] = "Markdown"; + CommentFormat[CommentFormat["Html"] = 1] = "Html"; +})(CommentFormat = exports.CommentFormat || (exports.CommentFormat = {})); /** * Represents different reaction types for a work item comment. */ @@ -55072,6 +66483,12 @@ exports.TypeInfo = { "all": -17 } }, + CommentFormat: { + enumValues: { + "markdown": 0, + "html": 1 + } + }, CommentList: {}, CommentReaction: {}, CommentReactionType: { @@ -55238,6 +66655,7 @@ exports.TypeInfo = { } }, WorkItemField: {}, + WorkItemField2: {}, WorkItemHistory: {}, WorkItemQueryClause: {}, WorkItemQueryResult: {}, @@ -55249,6 +66667,7 @@ exports.TypeInfo = { "restored": 3 } }, + WorkItemTagDefinition: {}, WorkItemTypeFieldsExpandLevel: { enumValues: { "none": 0, @@ -55316,6 +66735,9 @@ exports.TypeInfo.Comment.fields = { createdOnBehalfDate: { isDate: true, }, + format: { + enumType: exports.TypeInfo.CommentFormat + }, modifiedDate: { isDate: true, }, @@ -55422,6 +66844,9 @@ exports.TypeInfo.WorkItemClassificationNode.fields = { } }; exports.TypeInfo.WorkItemComment.fields = { + format: { + enumType: exports.TypeInfo.CommentFormat + }, revisedDate: { isDate: true, } @@ -55440,6 +66865,14 @@ exports.TypeInfo.WorkItemField.fields = { enumType: exports.TypeInfo.FieldUsage } }; +exports.TypeInfo.WorkItemField2.fields = { + type: { + enumType: exports.TypeInfo.FieldType + }, + usage: { + enumType: exports.TypeInfo.FieldUsage + } +}; exports.TypeInfo.WorkItemHistory.fields = { revisedDate: { isDate: true, @@ -55465,6 +66898,11 @@ exports.TypeInfo.WorkItemQueryResult.fields = { enumType: exports.TypeInfo.QueryType } }; +exports.TypeInfo.WorkItemTagDefinition.fields = { + lastUpdated: { + isDate: true, + } +}; exports.TypeInfo.WorkItemTypeTemplateUpdateModel.fields = { actionType: { enumType: exports.TypeInfo.ProvisioningActionType @@ -55497,6 +66935,7 @@ exports.TypeInfo.WorkItemUpdate.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.WorkItemTypeClass = exports.PageType = exports.GetWorkItemTypeExpand = exports.FieldType = void 0; /** * Enum for the type of a field. */ @@ -55687,6 +67126,7 @@ exports.TypeInfo.WorkItemTypeModel.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.WorkItemTypeClass = exports.RuleConditionType = exports.RuleActionType = exports.ProcessWorkItemTypeFieldsExpandLevel = exports.ProcessClass = exports.PageType = exports.GetWorkItemTypeExpand = exports.GetProcessExpandLevel = exports.GetBehaviorsExpand = exports.FieldType = exports.CustomizationType = void 0; /** * Indicates the customization-type. Customization-type is System if is system generated or by default. Customization-type is Inherited if the existing workitemtype of inherited process is customized. Customization-type is Custom if the newly created workitemtype is customized. */ @@ -55954,13 +67394,22 @@ var RuleConditionType; * $WhenNotChanged.This condition limits the execution of its children to cases when another field has not changed, i.e.when the Is value of the referenced field is equal to the Was value of that field. */ RuleConditionType[RuleConditionType["WhenNotChanged"] = 4] = "WhenNotChanged"; + /** + * $WhenWas. This condition limits the execution of its children to cases when another field value is changed from one value to another. e.g. If the condition is : When the work item state changes from New to Approved, here $WhenWas clause defines the "New" state of the workitem and $When clause defines "Approved" state. + */ RuleConditionType[RuleConditionType["WhenWas"] = 5] = "WhenWas"; RuleConditionType[RuleConditionType["WhenStateChangedTo"] = 6] = "WhenStateChangedTo"; RuleConditionType[RuleConditionType["WhenStateChangedFromAndTo"] = 7] = "WhenStateChangedFromAndTo"; RuleConditionType[RuleConditionType["WhenWorkItemIsCreated"] = 8] = "WhenWorkItemIsCreated"; RuleConditionType[RuleConditionType["WhenValueIsDefined"] = 9] = "WhenValueIsDefined"; RuleConditionType[RuleConditionType["WhenValueIsNotDefined"] = 10] = "WhenValueIsNotDefined"; + /** + * This condition checks if current user is member of a particular group. This condition does not have any 1:1 mapping with any server side rule condition, rather this is a dummy condition added for customer simplicity of understanding. This condition is later translated to a FOR membership filter . e.g. If the condition is : WhenCurrentUserIsMemberOfGroup "Approvers" then "MakeRequired" Field1.Here it translates to a For rule , "MakeRequired" for "Approvers" + */ RuleConditionType[RuleConditionType["WhenCurrentUserIsMemberOfGroup"] = 11] = "WhenCurrentUserIsMemberOfGroup"; + /** + * This condition checks if current user is not member of a particular group. This condition does not have any 1:1 mapping with any server side rule condition, rather this is a dummy condition added for customer simplicity of understanding. This condition is later translated to a NOT membership filter . e.g. If the condition is : WhenCurrentUserIsNotMemberOfGroup "Approvers" then "MakeRequired" Field1.Here it translates to a Not rule , "MakeRequired" not "Approvers" + */ RuleConditionType[RuleConditionType["WhenCurrentUserIsNotMemberOfGroup"] = 12] = "WhenCurrentUserIsNotMemberOfGroup"; })(RuleConditionType = exports.RuleConditionType || (exports.RuleConditionType = {})); var WorkItemTypeClass; @@ -56235,6 +67684,7 @@ exports.TypeInfo.WorkItemTypeModel.fields = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.InputMode = exports.InputFilterOperator = exports.InputDataType = void 0; var InputDataType; (function (InputDataType) { /** @@ -56404,20 +67854,24 @@ exports.TypeInfo.InputValuesQuery.fields = { "use strict"; /* -* --------------------------------------------------------- -* Copyright(C) Microsoft Corporation. All rights reserved. -* --------------------------------------------------------- -* -* --------------------------------------------------------- -* Generated file, DO NOT EDIT -* --------------------------------------------------------- -*/ + * --------------------------------------------------------- + * Copyright(C) Microsoft Corporation. All rights reserved. + * --------------------------------------------------------- + * + * --------------------------------------------------------- + * Generated file, DO NOT EDIT + * --------------------------------------------------------- + */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.OperationStatus = void 0; +/** + * The status of an operation. + */ var OperationStatus; (function (OperationStatus) { /** - * The operation object does not have the status set. + * The operation does not have a status set. */ OperationStatus[OperationStatus["NotSet"] = 0] = "NotSet"; /** @@ -56442,9 +67896,8 @@ var OperationStatus; OperationStatus[OperationStatus["Failed"] = 5] = "Failed"; })(OperationStatus = exports.OperationStatus || (exports.OperationStatus = {})); exports.TypeInfo = { - OperationReference: { - fields: null - }, + Operation: {}, + OperationReference: {}, OperationStatus: { enumValues: { "notSet": 0, @@ -56452,14 +67905,19 @@ exports.TypeInfo = { "inProgress": 2, "cancelled": 3, "succeeded": 4, - "failed": 5, + "failed": 5 } }, }; +exports.TypeInfo.Operation.fields = { + status: { + enumType: exports.TypeInfo.OperationStatus + } +}; exports.TypeInfo.OperationReference.fields = { status: { enumType: exports.TypeInfo.OperationStatus - }, + } }; @@ -56471,6 +67929,7 @@ exports.TypeInfo.OperationReference.fields = { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.DayOfWeek = void 0; var DayOfWeek; (function (DayOfWeek) { /** @@ -56528,6 +67987,7 @@ exports.TypeInfo = { // Copyright (C) Microsoft Corporation. All rights reserved. //---------------------------------------------------------- Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.SqlDbType = void 0; /** * Specifies SQL Server-specific data type of a field, property, for use in a System.Data.SqlClient.SqlParameter. */ @@ -56714,6 +68174,7 @@ exports.TypeInfo = { */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TypeInfo = exports.Operation = exports.JWTAlgorithm = exports.DeploymentFlags = exports.ConnectOptions = void 0; /** * Enumeration of the options that can be passed in on Connect. */ @@ -56824,7 +68285,84 @@ exports.TypeInfo.VssNotificationEvent.fields = { /***/ }), -/***/ 8803: +/***/ 9227: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var bind = __nccwpck_require__(8334); + +var $apply = __nccwpck_require__(4177); +var $call = __nccwpck_require__(2808); +var $reflectApply = __nccwpck_require__(8309); + +/** @type {import('./actualApply')} */ +module.exports = $reflectApply || bind.call($call, $apply); + + +/***/ }), + +/***/ 4177: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./functionApply')} */ +module.exports = Function.prototype.apply; + + +/***/ }), + +/***/ 2808: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./functionCall')} */ +module.exports = Function.prototype.call; + + +/***/ }), + +/***/ 6815: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var bind = __nccwpck_require__(8334); +var $TypeError = __nccwpck_require__(6361); + +var $call = __nccwpck_require__(2808); +var $actualApply = __nccwpck_require__(9227); + +/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ +module.exports = function callBindBasic(args) { + if (args.length < 1 || typeof args[0] !== 'function') { + throw new $TypeError('a function is required'); + } + return $actualApply(bind, $call, args); +}; + + +/***/ }), + +/***/ 8309: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./reflectApply')} */ +module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; + + +/***/ }), + +/***/ 1785: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -56832,14 +68370,18 @@ exports.TypeInfo.VssNotificationEvent.fields = { var GetIntrinsic = __nccwpck_require__(4538); -var callBind = __nccwpck_require__(2977); +var callBindBasic = __nccwpck_require__(6815); -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); +/** @type {(thisArg: string, searchString: string, position?: number) => number} */ +var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); +/** @type {import('.')} */ module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); + /* eslint no-extra-parens: 0 */ + + var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBind(intrinsic); + return callBindBasic(/** @type {const} */ ([intrinsic])); } return intrinsic; }; @@ -56847,57 +68389,880 @@ module.exports = function callBoundIntrinsic(name, allowMissing) { /***/ }), -/***/ 2977: +/***/ 8743: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +exports.utils = __nccwpck_require__(4171); +exports.Cipher = __nccwpck_require__(5068); +exports.DES = __nccwpck_require__(2957); +exports.CBC = __nccwpck_require__(9594); +exports.EDE = __nccwpck_require__(3408); + + +/***/ }), + +/***/ 9594: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +var assert = __nccwpck_require__(910); +var inherits = __nccwpck_require__(4124); + +var proto = {}; + +function CBCState(iv) { + assert.equal(iv.length, 8, 'Invalid IV length'); + + this.iv = new Array(8); + for (var i = 0; i < this.iv.length; i++) + this.iv[i] = iv[i]; +} + +function instantiate(Base) { + function CBC(options) { + Base.call(this, options); + this._cbcInit(); + } + inherits(CBC, Base); + + var keys = Object.keys(proto); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + CBC.prototype[key] = proto[key]; + } + + CBC.create = function create(options) { + return new CBC(options); + }; + + return CBC; +} + +exports.instantiate = instantiate; + +proto._cbcInit = function _cbcInit() { + var state = new CBCState(this.options.iv); + this._cbcState = state; +}; + +proto._update = function _update(inp, inOff, out, outOff) { + var state = this._cbcState; + var superProto = this.constructor.super_.prototype; + + var iv = state.iv; + if (this.type === 'encrypt') { + for (var i = 0; i < this.blockSize; i++) + iv[i] ^= inp[inOff + i]; + + superProto._update.call(this, iv, 0, out, outOff); + + for (var i = 0; i < this.blockSize; i++) + iv[i] = out[outOff + i]; + } else { + superProto._update.call(this, inp, inOff, out, outOff); + + for (var i = 0; i < this.blockSize; i++) + out[outOff + i] ^= iv[i]; + + for (var i = 0; i < this.blockSize; i++) + iv[i] = inp[inOff + i]; + } +}; + + +/***/ }), + +/***/ 5068: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var bind = __nccwpck_require__(8334); -var GetIntrinsic = __nccwpck_require__(4538); +var assert = __nccwpck_require__(910); + +function Cipher(options) { + this.options = options; + + this.type = this.options.type; + this.blockSize = 8; + this._init(); + + this.buffer = new Array(this.blockSize); + this.bufferOff = 0; + this.padding = options.padding !== false +} +module.exports = Cipher; + +Cipher.prototype._init = function _init() { + // Might be overrided +}; -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); +Cipher.prototype.update = function update(data) { + if (data.length === 0) + return []; -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $max = GetIntrinsic('%Math.max%'); + if (this.type === 'decrypt') + return this._updateDecrypt(data); + else + return this._updateEncrypt(data); +}; + +Cipher.prototype._buffer = function _buffer(data, off) { + // Append data to buffer + var min = Math.min(this.buffer.length - this.bufferOff, data.length - off); + for (var i = 0; i < min; i++) + this.buffer[this.bufferOff + i] = data[off + i]; + this.bufferOff += min; + + // Shift next + return min; +}; + +Cipher.prototype._flushBuffer = function _flushBuffer(out, off) { + this._update(this.buffer, 0, out, off); + this.bufferOff = 0; + return this.blockSize; +}; + +Cipher.prototype._updateEncrypt = function _updateEncrypt(data) { + var inputOff = 0; + var outputOff = 0; + + var count = ((this.bufferOff + data.length) / this.blockSize) | 0; + var out = new Array(count * this.blockSize); + + if (this.bufferOff !== 0) { + inputOff += this._buffer(data, inputOff); + + if (this.bufferOff === this.buffer.length) + outputOff += this._flushBuffer(out, outputOff); + } + + // Write blocks + var max = data.length - ((data.length - inputOff) % this.blockSize); + for (; inputOff < max; inputOff += this.blockSize) { + this._update(data, inputOff, out, outputOff); + outputOff += this.blockSize; + } + + // Queue rest + for (; inputOff < data.length; inputOff++, this.bufferOff++) + this.buffer[this.bufferOff] = data[inputOff]; + + return out; +}; + +Cipher.prototype._updateDecrypt = function _updateDecrypt(data) { + var inputOff = 0; + var outputOff = 0; + + var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1; + var out = new Array(count * this.blockSize); + + // TODO(indutny): optimize it, this is far from optimal + for (; count > 0; count--) { + inputOff += this._buffer(data, inputOff); + outputOff += this._flushBuffer(out, outputOff); + } + + // Buffer rest of the input + inputOff += this._buffer(data, inputOff); + + return out; +}; + +Cipher.prototype.final = function final(buffer) { + var first; + if (buffer) + first = this.update(buffer); + + var last; + if (this.type === 'encrypt') + last = this._finalEncrypt(); + else + last = this._finalDecrypt(); + + if (first) + return first.concat(last); + else + return last; +}; + +Cipher.prototype._pad = function _pad(buffer, off) { + if (off === 0) + return false; + while (off < buffer.length) + buffer[off++] = 0; + + return true; +}; + +Cipher.prototype._finalEncrypt = function _finalEncrypt() { + if (!this._pad(this.buffer, this.bufferOff)) + return []; + + var out = new Array(this.blockSize); + this._update(this.buffer, 0, out, 0); + return out; +}; + +Cipher.prototype._unpad = function _unpad(buffer) { + return buffer; +}; + +Cipher.prototype._finalDecrypt = function _finalDecrypt() { + assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt'); + var out = new Array(this.blockSize); + this._flushBuffer(out, 0); + + return this._unpad(out); +}; + + +/***/ }), + +/***/ 2957: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var assert = __nccwpck_require__(910); +var inherits = __nccwpck_require__(4124); + +var utils = __nccwpck_require__(4171); +var Cipher = __nccwpck_require__(5068); + +function DESState() { + this.tmp = new Array(2); + this.keys = null; +} + +function DES(options) { + Cipher.call(this, options); + + var state = new DESState(); + this._desState = state; + + this.deriveKeys(state, options.key); +} +inherits(DES, Cipher); +module.exports = DES; + +DES.create = function create(options) { + return new DES(options); +}; + +var shiftTable = [ + 1, 1, 2, 2, 2, 2, 2, 2, + 1, 2, 2, 2, 2, 2, 2, 1 +]; + +DES.prototype.deriveKeys = function deriveKeys(state, key) { + state.keys = new Array(16 * 2); + + assert.equal(key.length, this.blockSize, 'Invalid key length'); + + var kL = utils.readUInt32BE(key, 0); + var kR = utils.readUInt32BE(key, 4); + + utils.pc1(kL, kR, state.tmp, 0); + kL = state.tmp[0]; + kR = state.tmp[1]; + for (var i = 0; i < state.keys.length; i += 2) { + var shift = shiftTable[i >>> 1]; + kL = utils.r28shl(kL, shift); + kR = utils.r28shl(kR, shift); + utils.pc2(kL, kR, state.keys, i); + } +}; + +DES.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._desState; + + var l = utils.readUInt32BE(inp, inOff); + var r = utils.readUInt32BE(inp, inOff + 4); + + // Initial Permutation + utils.ip(l, r, state.tmp, 0); + l = state.tmp[0]; + r = state.tmp[1]; + + if (this.type === 'encrypt') + this._encrypt(state, l, r, state.tmp, 0); + else + this._decrypt(state, l, r, state.tmp, 0); + + l = state.tmp[0]; + r = state.tmp[1]; + + utils.writeUInt32BE(out, l, outOff); + utils.writeUInt32BE(out, r, outOff + 4); +}; + +DES.prototype._pad = function _pad(buffer, off) { + if (this.padding === false) { + return false; + } + + var value = buffer.length - off; + for (var i = off; i < buffer.length; i++) + buffer[i] = value; + + return true; +}; + +DES.prototype._unpad = function _unpad(buffer) { + if (this.padding === false) { + return buffer; + } + + var pad = buffer[buffer.length - 1]; + for (var i = buffer.length - pad; i < buffer.length; i++) + assert.equal(buffer[i], pad); + + return buffer.slice(0, buffer.length - pad); +}; + +DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) { + var l = lStart; + var r = rStart; + + // Apply f() x16 times + for (var i = 0; i < state.keys.length; i += 2) { + var keyL = state.keys[i]; + var keyR = state.keys[i + 1]; + + // f(r, k) + utils.expand(r, state.tmp, 0); + + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s = utils.substitute(keyL, keyR); + var f = utils.permute(s); + + var t = r; + r = (l ^ f) >>> 0; + l = t; + } + + // Reverse Initial Permutation + utils.rip(r, l, out, off); +}; + +DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { + var l = rStart; + var r = lStart; + + // Apply f() x16 times + for (var i = state.keys.length - 2; i >= 0; i -= 2) { + var keyL = state.keys[i]; + var keyR = state.keys[i + 1]; + + // f(r, k) + utils.expand(l, state.tmp, 0); + + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s = utils.substitute(keyL, keyR); + var f = utils.permute(s); + + var t = l; + l = (r ^ f) >>> 0; + r = t; + } + + // Reverse Initial Permutation + utils.rip(l, r, out, off); +}; + + +/***/ }), + +/***/ 3408: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var assert = __nccwpck_require__(910); +var inherits = __nccwpck_require__(4124); + +var Cipher = __nccwpck_require__(5068); +var DES = __nccwpck_require__(2957); + +function EDEState(type, key) { + assert.equal(key.length, 24, 'Invalid key length'); + + var k1 = key.slice(0, 8); + var k2 = key.slice(8, 16); + var k3 = key.slice(16, 24); + + if (type === 'encrypt') { + this.ciphers = [ + DES.create({ type: 'encrypt', key: k1 }), + DES.create({ type: 'decrypt', key: k2 }), + DES.create({ type: 'encrypt', key: k3 }) + ]; + } else { + this.ciphers = [ + DES.create({ type: 'decrypt', key: k3 }), + DES.create({ type: 'encrypt', key: k2 }), + DES.create({ type: 'decrypt', key: k1 }) + ]; + } +} + +function EDE(options) { + Cipher.call(this, options); + + var state = new EDEState(this.type, this.options.key); + this._edeState = state; +} +inherits(EDE, Cipher); + +module.exports = EDE; + +EDE.create = function create(options) { + return new EDE(options); +}; + +EDE.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._edeState; + + state.ciphers[0]._update(inp, inOff, out, outOff); + state.ciphers[1]._update(out, outOff, out, outOff); + state.ciphers[2]._update(out, outOff, out, outOff); +}; + +EDE.prototype._pad = DES.prototype._pad; +EDE.prototype._unpad = DES.prototype._unpad; + + +/***/ }), + +/***/ 4171: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +exports.readUInt32BE = function readUInt32BE(bytes, off) { + var res = (bytes[0 + off] << 24) | + (bytes[1 + off] << 16) | + (bytes[2 + off] << 8) | + bytes[3 + off]; + return res >>> 0; +}; + +exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) { + bytes[0 + off] = value >>> 24; + bytes[1 + off] = (value >>> 16) & 0xff; + bytes[2 + off] = (value >>> 8) & 0xff; + bytes[3 + off] = value & 0xff; +}; + +exports.ip = function ip(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + for (var i = 6; i >= 0; i -= 2) { + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inR >>> (j + i)) & 1; + } + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inL >>> (j + i)) & 1; + } + } + + for (var i = 6; i >= 0; i -= 2) { + for (var j = 1; j <= 25; j += 8) { + outR <<= 1; + outR |= (inR >>> (j + i)) & 1; + } + for (var j = 1; j <= 25; j += 8) { + outR <<= 1; + outR |= (inL >>> (j + i)) & 1; + } + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.rip = function rip(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + for (var i = 0; i < 4; i++) { + for (var j = 24; j >= 0; j -= 8) { + outL <<= 1; + outL |= (inR >>> (j + i)) & 1; + outL <<= 1; + outL |= (inL >>> (j + i)) & 1; + } + } + for (var i = 4; i < 8; i++) { + for (var j = 24; j >= 0; j -= 8) { + outR <<= 1; + outR |= (inR >>> (j + i)) & 1; + outR <<= 1; + outR |= (inL >>> (j + i)) & 1; + } + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.pc1 = function pc1(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + // 7, 15, 23, 31, 39, 47, 55, 63 + // 6, 14, 22, 30, 39, 47, 55, 63 + // 5, 13, 21, 29, 39, 47, 55, 63 + // 4, 12, 20, 28 + for (var i = 7; i >= 5; i--) { + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inR >> (j + i)) & 1; + } + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inL >> (j + i)) & 1; + } + } + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inR >> (j + i)) & 1; + } + + // 1, 9, 17, 25, 33, 41, 49, 57 + // 2, 10, 18, 26, 34, 42, 50, 58 + // 3, 11, 19, 27, 35, 43, 51, 59 + // 36, 44, 52, 60 + for (var i = 1; i <= 3; i++) { + for (var j = 0; j <= 24; j += 8) { + outR <<= 1; + outR |= (inR >> (j + i)) & 1; + } + for (var j = 0; j <= 24; j += 8) { + outR <<= 1; + outR |= (inL >> (j + i)) & 1; + } + } + for (var j = 0; j <= 24; j += 8) { + outR <<= 1; + outR |= (inL >> (j + i)) & 1; + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.r28shl = function r28shl(num, shift) { + return ((num << shift) & 0xfffffff) | (num >>> (28 - shift)); +}; + +var pc2table = [ + // inL => outL + 14, 11, 17, 4, 27, 23, 25, 0, + 13, 22, 7, 18, 5, 9, 16, 24, + 2, 20, 12, 21, 1, 8, 15, 26, + + // inR => outR + 15, 4, 25, 19, 9, 1, 26, 16, + 5, 11, 23, 8, 12, 7, 17, 0, + 22, 3, 10, 14, 6, 20, 27, 24 +]; + +exports.pc2 = function pc2(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + var len = pc2table.length >>> 1; + for (var i = 0; i < len; i++) { + outL <<= 1; + outL |= (inL >>> pc2table[i]) & 0x1; + } + for (var i = len; i < pc2table.length; i++) { + outR <<= 1; + outR |= (inR >>> pc2table[i]) & 0x1; + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.expand = function expand(r, out, off) { + var outL = 0; + var outR = 0; + + outL = ((r & 1) << 5) | (r >>> 27); + for (var i = 23; i >= 15; i -= 4) { + outL <<= 6; + outL |= (r >>> i) & 0x3f; + } + for (var i = 11; i >= 3; i -= 4) { + outR |= (r >>> i) & 0x3f; + outR <<= 6; + } + outR |= ((r & 0x1f) << 1) | (r >>> 31); + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +var sTable = [ + 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, + 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, + 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, + 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, + + 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, + 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, + 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, + 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, + + 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, + 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, + 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, + 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, + + 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, + 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, + 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, + 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, + + 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, + 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, + 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, + 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, + + 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, + 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, + 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, + 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, + + 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, + 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, + 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, + 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, + + 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, + 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, + 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, + 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11 +]; + +exports.substitute = function substitute(inL, inR) { + var out = 0; + for (var i = 0; i < 4; i++) { + var b = (inL >>> (18 - i * 6)) & 0x3f; + var sb = sTable[i * 0x40 + b]; + + out <<= 4; + out |= sb; + } + for (var i = 0; i < 4; i++) { + var b = (inR >>> (18 - i * 6)) & 0x3f; + var sb = sTable[4 * 0x40 + i * 0x40 + b]; + + out <<= 4; + out |= sb; + } + return out >>> 0; +}; + +var permuteTable = [ + 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, + 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7 +]; + +exports.permute = function permute(num) { + var out = 0; + for (var i = 0; i < permuteTable.length; i++) { + out <<= 1; + out |= (num >>> permuteTable[i]) & 0x1; + } + return out >>> 0; +}; + +exports.padSplit = function padSplit(num, size, group) { + var str = num.toString(2); + while (str.length < size) + str = '0' + str; + + var out = []; + for (var i = 0; i < size; i += group) + out.push(str.slice(i, i + group)); + return out.join(' '); +}; + + +/***/ }), + +/***/ 2693: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var callBind = __nccwpck_require__(6815); +var gOPD = __nccwpck_require__(8501); + +var hasProtoAccessor; +try { + // eslint-disable-next-line no-extra-parens, no-proto + hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; +} catch (e) { + if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { + throw e; + } +} + +// eslint-disable-next-line no-extra-parens +var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); + +var $Object = Object; +var $getPrototypeOf = $Object.getPrototypeOf; + +/** @type {import('./get')} */ +module.exports = desc && typeof desc.get === 'function' + ? callBind([desc.get]) + : typeof $getPrototypeOf === 'function' + ? /** @type {import('./get')} */ function getDunder(value) { + // eslint-disable-next-line eqeqeq + return $getPrototypeOf(value == null ? value : $Object(value)); + } + : false; + + +/***/ }), + +/***/ 6123: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('.')} */ +var $defineProperty = Object.defineProperty || false; if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); } catch (e) { // IE 8 has a broken defineProperty - $defineProperty = null; + $defineProperty = false; } } -module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, 'length'); - if (desc.configurable) { - // original length, plus the receiver, minus any additional arguments (after the receiver) - $defineProperty( - func, - 'length', - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } - } - return func; -}; +module.exports = $defineProperty; + + +/***/ }), + +/***/ 1933: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./eval')} */ +module.exports = EvalError; + + +/***/ }), + +/***/ 8015: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('.')} */ +module.exports = Error; + + +/***/ }), + +/***/ 4415: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./range')} */ +module.exports = RangeError; + + +/***/ }), + +/***/ 6279: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./ref')} */ +module.exports = ReferenceError; + + +/***/ }), + +/***/ 5474: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./syntax')} */ +module.exports = SyntaxError; + + +/***/ }), + +/***/ 6361: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./type')} */ +module.exports = TypeError; + + +/***/ }), + +/***/ 5065: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./uri')} */ +module.exports = URIError; + + +/***/ }), + +/***/ 8308: +/***/ ((module) => { + +"use strict"; -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} +/** @type {import('.')} */ +module.exports = Object; /***/ }), @@ -56911,43 +69276,75 @@ if ($defineProperty) { /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; var toStr = Object.prototype.toString; +var max = Math.max; var funcType = '[object Function]'; +var concatty = function concatty(a, b) { + var arr = []; + + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + + return arr; +}; + +var slicy = function slicy(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; +}; + +var joiny = function (arr, joiner) { + var str = ''; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; +}; + module.exports = function bind(that) { var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { + if (typeof target !== 'function' || toStr.apply(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } - var args = slice.call(arguments, 1); + var args = slicy(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply( this, - args.concat(slice.call(arguments)) + concatty(args, arguments) ); if (Object(result) === result) { return result; } return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); } + return target.apply( + that, + concatty(args, arguments) + ); + }; - var boundLength = Math.max(0, target.length - args.length); + var boundLength = max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); + boundArgs[i] = '$' + i; } - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; @@ -56983,9 +69380,25 @@ module.exports = Function.prototype.bind || implementation; var undefined; -var $SyntaxError = SyntaxError; +var $Object = __nccwpck_require__(8308); + +var $Error = __nccwpck_require__(8015); +var $EvalError = __nccwpck_require__(1933); +var $RangeError = __nccwpck_require__(4415); +var $ReferenceError = __nccwpck_require__(6279); +var $SyntaxError = __nccwpck_require__(5474); +var $TypeError = __nccwpck_require__(6361); +var $URIError = __nccwpck_require__(5065); + +var abs = __nccwpck_require__(9775); +var floor = __nccwpck_require__(924); +var max = __nccwpck_require__(2419); +var min = __nccwpck_require__(3373); +var pow = __nccwpck_require__(8029); +var round = __nccwpck_require__(9396); +var sign = __nccwpck_require__(9091); + var $Function = Function; -var $TypeError = TypeError; // eslint-disable-next-line consistent-return var getEvalledConstructor = function (expressionSyntax) { @@ -56994,14 +69407,8 @@ var getEvalledConstructor = function (expressionSyntax) { } catch (e) {} }; -var $gOPD = Object.getOwnPropertyDescriptor; -if ($gOPD) { - try { - $gOPD({}, ''); - } catch (e) { - $gOPD = null; // this is IE 8, which has a broken gOPD - } -} +var $gOPD = __nccwpck_require__(8501); +var $defineProperty = __nccwpck_require__(6123); var throwTypeError = function () { throw new $TypeError(); @@ -57025,17 +69432,23 @@ var ThrowTypeError = $gOPD var hasSymbols = __nccwpck_require__(587)(); -var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto +var getProto = __nccwpck_require__(3592); +var $ObjectGPO = __nccwpck_require__(5045); +var $ReflectGPO = __nccwpck_require__(8859); + +var $apply = __nccwpck_require__(4177); +var $call = __nccwpck_require__(2808); var needsEval = {}; -var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); +var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); var INTRINSICS = { + __proto__: null, '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, - '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': needsEval, '%AsyncGenerator%': needsEval, @@ -57043,6 +69456,8 @@ var INTRINSICS = { '%AsyncIteratorPrototype%': needsEval, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, + '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, + '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, '%Boolean%': Boolean, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%Date%': Date, @@ -57050,9 +69465,10 @@ var INTRINSICS = { '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, - '%Error%': Error, + '%Error%': $Error, '%eval%': eval, // eslint-disable-line no-eval - '%EvalError%': EvalError, + '%EvalError%': $EvalError, + '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, @@ -57063,26 +69479,27 @@ var INTRINSICS = { '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%isFinite%': isFinite, '%isNaN%': isNaN, - '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, - '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), '%Math%': Math, '%Number%': Number, - '%Object%': Object, + '%Object%': $Object, + '%Object.getOwnPropertyDescriptor%': $gOPD, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, - '%RangeError%': RangeError, - '%ReferenceError%': ReferenceError, + '%RangeError%': $RangeError, + '%ReferenceError%': $ReferenceError, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%Set%': typeof Set === 'undefined' ? undefined : Set, - '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%String%': String, - '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, '%Symbol%': hasSymbols ? Symbol : undefined, '%SyntaxError%': $SyntaxError, '%ThrowTypeError%': ThrowTypeError, @@ -57092,11 +69509,34 @@ var INTRINSICS = { '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, - '%URIError%': URIError, + '%URIError%': $URIError, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, - '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet -}; + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + + '%Function.prototype.call%': $call, + '%Function.prototype.apply%': $apply, + '%Object.defineProperty%': $defineProperty, + '%Object.getPrototypeOf%': $ObjectGPO, + '%Math.abs%': abs, + '%Math.floor%': floor, + '%Math.max%': max, + '%Math.min%': min, + '%Math.pow%': pow, + '%Math.round%': round, + '%Math.sign%': sign, + '%Reflect.getPrototypeOf%': $ReflectGPO +}; + +if (getProto) { + try { + null.error; // eslint-disable-line no-unused-expressions + } catch (e) { + // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 + var errorProto = getProto(getProto(e)); + INTRINSICS['%Error.prototype%'] = errorProto; + } +} var doEval = function doEval(name) { var value; @@ -57113,7 +69553,7 @@ var doEval = function doEval(name) { } } else if (name === '%AsyncIteratorPrototype%') { var gen = doEval('%AsyncGenerator%'); - if (gen) { + if (gen && getProto) { value = getProto(gen.prototype); } } @@ -57124,6 +69564,7 @@ var doEval = function doEval(name) { }; var LEGACY_ALIASES = { + __proto__: null, '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], '%ArrayPrototype%': ['Array', 'prototype'], '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], @@ -57178,11 +69619,12 @@ var LEGACY_ALIASES = { }; var bind = __nccwpck_require__(8334); -var hasOwn = __nccwpck_require__(6339); -var $concat = bind.call(Function.call, Array.prototype.concat); -var $spliceApply = bind.call(Function.apply, Array.prototype.splice); -var $replace = bind.call(Function.call, String.prototype.replace); -var $strSlice = bind.call(Function.call, String.prototype.slice); +var hasOwn = __nccwpck_require__(2157); +var $concat = bind.call($call, Array.prototype.concat); +var $spliceApply = bind.call($apply, Array.prototype.splice); +var $replace = bind.call($call, String.prototype.replace); +var $strSlice = bind.call($call, String.prototype.slice); +var $exec = bind.call($call, RegExp.prototype.exec); /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; @@ -57238,6 +69680,9 @@ module.exports = function GetIntrinsic(name, allowMissing) { throw new $TypeError('"allowMissing" argument must be a boolean'); } + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); + } var parts = stringToPath(name); var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; @@ -57311,6 +69756,102 @@ module.exports = function GetIntrinsic(name, allowMissing) { }; +/***/ }), + +/***/ 5045: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var $Object = __nccwpck_require__(8308); + +/** @type {import('./Object.getPrototypeOf')} */ +module.exports = $Object.getPrototypeOf || null; + + +/***/ }), + +/***/ 8859: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./Reflect.getPrototypeOf')} */ +module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; + + +/***/ }), + +/***/ 3592: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var reflectGetProto = __nccwpck_require__(8859); +var originalGetProto = __nccwpck_require__(5045); + +var getDunderProto = __nccwpck_require__(2693); + +/** @type {import('.')} */ +module.exports = reflectGetProto + ? function getProto(O) { + // @ts-expect-error TS can't narrow inside a closure, for some reason + return reflectGetProto(O); + } + : originalGetProto + ? function getProto(O) { + if (!O || (typeof O !== 'object' && typeof O !== 'function')) { + throw new TypeError('getProto: not an object'); + } + // @ts-expect-error TS can't narrow inside a closure, for some reason + return originalGetProto(O); + } + : getDunderProto + ? function getProto(O) { + // @ts-expect-error TS can't narrow inside a closure, for some reason + return getDunderProto(O); + } + : null; + + +/***/ }), + +/***/ 7087: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./gOPD')} */ +module.exports = Object.getOwnPropertyDescriptor; + + +/***/ }), + +/***/ 8501: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/** @type {import('.')} */ +var $gOPD = __nccwpck_require__(7087); + +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; + + /***/ }), /***/ 587: @@ -57322,6 +69863,7 @@ module.exports = function GetIntrinsic(name, allowMissing) { var origSymbol = typeof Symbol !== 'undefined' && Symbol; var hasSymbolSham = __nccwpck_require__(7747); +/** @type {import('.')} */ module.exports = function hasNativeSymbols() { if (typeof origSymbol !== 'function') { return false; } if (typeof Symbol !== 'function') { return false; } @@ -57340,11 +69882,13 @@ module.exports = function hasNativeSymbols() { "use strict"; +/** @type {import('./shams')} */ /* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() { if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } if (typeof Symbol.iterator === 'symbol') { return true; } + /** @type {{ [k in symbol]?: unknown }} */ var obj = {}; var sym = Symbol('test'); var symObj = Object(sym); @@ -57363,7 +69907,7 @@ module.exports = function hasSymbols() { var symVal = 42; obj[sym] = symVal; - for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop + for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } @@ -57374,7 +69918,8 @@ module.exports = function hasSymbols() { if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } if (typeof Object.getOwnPropertyDescriptor === 'function') { - var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + // eslint-disable-next-line no-extra-parens + var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } } @@ -57384,15 +69929,772 @@ module.exports = function hasSymbols() { /***/ }), -/***/ 6339: +/***/ 2157: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +var call = Function.prototype.call; +var $hasOwn = Object.prototype.hasOwnProperty; var bind = __nccwpck_require__(8334); -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); +/** @type {import('.')} */ +module.exports = bind.call(call, $hasOwn); + + +/***/ }), + +/***/ 4124: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +try { + var util = __nccwpck_require__(3837); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = __nccwpck_require__(8544); +} + + +/***/ }), + +/***/ 8544: +/***/ ((module) => { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} + + +/***/ }), + +/***/ 561: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/** + * [js-md4]{@link https://github.com/emn178/js-md4} + * + * @namespace md4 + * @version 0.3.2 + * @author Yi-Cyuan Chen [emn178@gmail.com] + * @copyright Yi-Cyuan Chen 2015-2027 + * @license MIT + */ +/*jslint bitwise: true */ +(function () { + 'use strict'; + + var root = typeof window === 'object' ? window : {}; + var NODE_JS = !root.JS_MD4_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; + if (NODE_JS) { + root = global; + } + var COMMON_JS = !root.JS_MD4_NO_COMMON_JS && "object" === 'object' && module.exports; + var AMD = typeof define === 'function' && define.amd; + var ARRAY_BUFFER = !root.JS_MD4_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined'; + var HEX_CHARS = '0123456789abcdef'.split(''); + var EXTRA = [128, 32768, 8388608, -2147483648]; + var SHIFT = [0, 8, 16, 24]; + var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer']; + + var blocks = [], buffer8; + if (ARRAY_BUFFER) { + var buffer = new ArrayBuffer(68); + buffer8 = new Uint8Array(buffer); + blocks = new Uint32Array(buffer); + } + + /** + * @method hex + * @memberof md4 + * @description Output hash as hex string + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {String} Hex string + * @example + * md4.hex('The quick brown fox jumps over the lazy dog'); + * // equal to + * md4('The quick brown fox jumps over the lazy dog'); + */ + /** + * @method digest + * @memberof md4 + * @description Output hash as bytes array + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Array} Bytes array + * @example + * md4.digest('The quick brown fox jumps over the lazy dog'); + */ + /** + * @method array + * @memberof md4 + * @description Output hash as bytes array + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Array} Bytes array + * @example + * md4.array('The quick brown fox jumps over the lazy dog'); + */ + /** + * @method buffer + * @memberof md4 + * @description Output hash as ArrayBuffer + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {ArrayBuffer} ArrayBuffer + * @example + * md4.buffer('The quick brown fox jumps over the lazy dog'); + */ + var createOutputMethod = function (outputType) { + return function(message) { + return new Md4(true).update(message)[outputType](); + } + }; + + /** + * @method create + * @memberof md4 + * @description Create Md4 object + * @returns {Md4} MD4 object. + * @example + * var hash = md4.create(); + */ + /** + * @method update + * @memberof md4 + * @description Create and update Md4 object + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Md4} MD4 object. + * @example + * var hash = md4.update('The quick brown fox jumps over the lazy dog'); + * // equal to + * var hash = md4.create(); + * hash.update('The quick brown fox jumps over the lazy dog'); + */ + var createMethod = function () { + var method = createOutputMethod('hex'); + if (NODE_JS) { + method = nodeWrap(method); + } + method.create = function () { + return new Md4(); + }; + method.update = function (message) { + return method.create().update(message); + }; + for (var i = 0; i < OUTPUT_TYPES.length; ++i) { + var type = OUTPUT_TYPES[i]; + method[type] = createOutputMethod(type); + } + return method; + }; + + var nodeWrap = function (method) { + var crypto = __nccwpck_require__(6113); + var Buffer = (__nccwpck_require__(4300).Buffer); + var nodeMethod = function (message) { + if (typeof message === 'string') { + return crypto.createHash('md4').update(message, 'utf8').digest('hex'); + } else if (ARRAY_BUFFER && message instanceof ArrayBuffer) { + message = new Uint8Array(message); + } else if (message.length === undefined) { + return method(message); + } + return crypto.createHash('md4').update(new Buffer(message)).digest('hex'); + }; + return nodeMethod; + }; + + /** + * Md4 class + * @class Md4 + * @description This is internal class. + * @see {@link md4.create} + */ + function Md4(sharedMemory) { + if (sharedMemory) { + blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + this.blocks = blocks; + this.buffer8 = buffer8; + } else { + if (ARRAY_BUFFER) { + var buffer = new ArrayBuffer(68); + this.buffer8 = new Uint8Array(buffer); + this.blocks = new Uint32Array(buffer); + } else { + this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + } + } + this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = 0; + this.finalized = this.hashed = false; + this.first = true; + } + + /** + * @method update + * @memberof Md4 + * @instance + * @description Update hash + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Md4} MD4 object. + * @see {@link md4.update} + */ + Md4.prototype.update = function (message) { + if (this.finalized) { + return; + } + var notString = typeof message !== 'string'; + if (notString && ARRAY_BUFFER && message instanceof ArrayBuffer) { + message = new Uint8Array(message); + } + var code, index = 0, i, length = message.length || 0, blocks = this.blocks; + var buffer8 = this.buffer8; + + while (index < length) { + if (this.hashed) { + this.hashed = false; + blocks[0] = blocks[16]; + blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + } + + if (notString) { + if (ARRAY_BUFFER) { + for (i = this.start; index < length && i < 64; ++index) { + buffer8[i++] = message[index]; + } + } else { + for (i = this.start; index < length && i < 64; ++index) { + blocks[i >> 2] |= message[index] << SHIFT[i++ & 3]; + } + } + } else { + if (ARRAY_BUFFER) { + for (i = this.start; index < length && i < 64; ++index) { + code = message.charCodeAt(index); + if (code < 0x80) { + buffer8[i++] = code; + } else if (code < 0x800) { + buffer8[i++] = 0xc0 | (code >> 6); + buffer8[i++] = 0x80 | (code & 0x3f); + } else if (code < 0xd800 || code >= 0xe000) { + buffer8[i++] = 0xe0 | (code >> 12); + buffer8[i++] = 0x80 | ((code >> 6) & 0x3f); + buffer8[i++] = 0x80 | (code & 0x3f); + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); + buffer8[i++] = 0xf0 | (code >> 18); + buffer8[i++] = 0x80 | ((code >> 12) & 0x3f); + buffer8[i++] = 0x80 | ((code >> 6) & 0x3f); + buffer8[i++] = 0x80 | (code & 0x3f); + } + } + } else { + for (i = this.start; index < length && i < 64; ++index) { + code = message.charCodeAt(index); + if (code < 0x80) { + blocks[i >> 2] |= code << SHIFT[i++ & 3]; + } else if (code < 0x800) { + blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } else if (code < 0xd800 || code >= 0xe000) { + blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); + blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } + } + } + } + this.lastByteIndex = i; + this.bytes += i - this.start; + if (i >= 64) { + this.start = i - 64; + this.hash(); + this.hashed = true; + } else { + this.start = i; + } + } + return this; + }; + + Md4.prototype.finalize = function () { + if (this.finalized) { + return; + } + this.finalized = true; + var blocks = this.blocks, i = this.lastByteIndex; + blocks[i >> 2] |= EXTRA[i & 3]; + if (i >= 56) { + if (!this.hashed) { + this.hash(); + } + blocks[0] = blocks[16]; + blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + } + blocks[14] = this.bytes << 3; + this.hash(); + }; + + Md4.prototype.hash = function () { + var a, b, c, d, ab, bc, cd, da, blocks = this.blocks; + + if (this.first) { + a = blocks[0] - 1; + a = (a << 3) | (a >>> 29); + d = ((a & 0xefcdab89) | (~a & 0x98badcfe)) + blocks[1] + 271733878; + d = (d << 7) | (d >>> 25); + c = ((d & a) | (~d & 0xefcdab89)) + blocks[2] - 1732584194; + c = (c << 11) | (c >>> 21); + b = ((c & d) | (~c & a)) + blocks[3] - 271733879; + b = (b << 19) | (b >>> 13); + } else { + a = this.h0; + b = this.h1; + c = this.h2; + d = this.h3; + a += ((b & c) | (~b & d)) + blocks[0]; + a = (a << 3) | (a >>> 29); + d += ((a & b) | (~a & c)) + blocks[1]; + d = (d << 7) | (d >>> 25); + c += ((d & a) | (~d & b)) + blocks[2]; + c = (c << 11) | (c >>> 21); + b += ((c & d) | (~c & a)) + blocks[3]; + b = (b << 19) | (b >>> 13); + } + a += ((b & c) | (~b & d)) + blocks[4]; + a = (a << 3) | (a >>> 29); + d += ((a & b) | (~a & c)) + blocks[5]; + d = (d << 7) | (d >>> 25); + c += ((d & a) | (~d & b)) + blocks[6]; + c = (c << 11) | (c >>> 21); + b += ((c & d) | (~c & a)) + blocks[7]; + b = (b << 19) | (b >>> 13); + a += ((b & c) | (~b & d)) + blocks[8]; + a = (a << 3) | (a >>> 29); + d += ((a & b) | (~a & c)) + blocks[9]; + d = (d << 7) | (d >>> 25); + c += ((d & a) | (~d & b)) + blocks[10]; + c = (c << 11) | (c >>> 21); + b += ((c & d) | (~c & a)) + blocks[11]; + b = (b << 19) | (b >>> 13); + a += ((b & c) | (~b & d)) + blocks[12]; + a = (a << 3) | (a >>> 29); + d += ((a & b) | (~a & c)) + blocks[13]; + d = (d << 7) | (d >>> 25); + c += ((d & a) | (~d & b)) + blocks[14]; + c = (c << 11) | (c >>> 21); + b += ((c & d) | (~c & a)) + blocks[15]; + b = (b << 19) | (b >>> 13); + + bc = b & c; + a += (bc | (b & d) | (c & d)) + blocks[0] + 1518500249; + a = (a << 3) | (a >>> 29); + ab = a & b; + d += (ab | (a & c) | bc) + blocks[4] + 1518500249; + d = (d << 5) | (d >>> 27); + da = d & a; + c += (da | (d & b) | ab) + blocks[8] + 1518500249; + c = (c << 9) | (c >>> 23); + cd = c & d; + b += (cd | (c & a) | da) + blocks[12] + 1518500249; + b = (b << 13) | (b >>> 19); + bc = b & c; + a += (bc | (b & d) | cd) + blocks[1] + 1518500249; + a = (a << 3) | (a >>> 29); + ab = a & b; + d += (ab | (a & c) | bc) + blocks[5] + 1518500249; + d = (d << 5) | (d >>> 27); + da = d & a; + c += (da | (d & b) | ab) + blocks[9] + 1518500249; + c = (c << 9) | (c >>> 23); + cd = c & d; + b += (cd | (c & a) | da) + blocks[13] + 1518500249; + b = (b << 13) | (b >>> 19); + bc = b & c; + a += (bc | (b & d) | cd) + blocks[2] + 1518500249; + a = (a << 3) | (a >>> 29); + ab = a & b; + d += (ab | (a & c) | bc) + blocks[6] + 1518500249; + d = (d << 5) | (d >>> 27); + da = d & a; + c += (da | (d & b) | ab) + blocks[10] + 1518500249; + c = (c << 9) | (c >>> 23); + cd = c & d; + b += (cd | (c & a) | da) + blocks[14] + 1518500249; + b = (b << 13) | (b >>> 19); + bc = b & c; + a += (bc | (b & d) | cd) + blocks[3] + 1518500249; + a = (a << 3) | (a >>> 29); + ab = a & b; + d += (ab | (a & c) | bc) + blocks[7] + 1518500249; + d = (d << 5) | (d >>> 27); + da = d & a; + c += (da | (d & b) | ab) + blocks[11] + 1518500249; + c = (c << 9) | (c >>> 23); + b += ((c & d) | (c & a) | da) + blocks[15] + 1518500249; + b = (b << 13) | (b >>> 19); + + bc = b ^ c; + a += (bc ^ d) + blocks[0] + 1859775393; + a = (a << 3) | (a >>> 29); + d += (bc ^ a) + blocks[8] + 1859775393; + d = (d << 9) | (d >>> 23); + da = d ^ a; + c += (da ^ b) + blocks[4] + 1859775393; + c = (c << 11) | (c >>> 21); + b += (da ^ c) + blocks[12] + 1859775393; + b = (b << 15) | (b >>> 17); + bc = b ^ c; + a += (bc ^ d) + blocks[2] + 1859775393; + a = (a << 3) | (a >>> 29); + d += (bc ^ a) + blocks[10] + 1859775393; + d = (d << 9) | (d >>> 23); + da = d ^ a; + c += (da ^ b) + blocks[6] + 1859775393; + c = (c << 11) | (c >>> 21); + b += (da ^ c) + blocks[14] + 1859775393; + b = (b << 15) | (b >>> 17); + bc = b ^ c; + a += (bc ^ d) + blocks[1] + 1859775393; + a = (a << 3) | (a >>> 29); + d += (bc ^ a) + blocks[9] + 1859775393; + d = (d << 9) | (d >>> 23); + da = d ^ a; + c += (da ^ b) + blocks[5] + 1859775393; + c = (c << 11) | (c >>> 21); + b += (da ^ c) + blocks[13] + 1859775393; + b = (b << 15) | (b >>> 17); + bc = b ^ c; + a += (bc ^ d) + blocks[3] + 1859775393; + a = (a << 3) | (a >>> 29); + d += (bc ^ a) + blocks[11] + 1859775393; + d = (d << 9) | (d >>> 23); + da = d ^ a; + c += (da ^ b) + blocks[7] + 1859775393; + c = (c << 11) | (c >>> 21); + b += (da ^ c) + blocks[15] + 1859775393; + b = (b << 15) | (b >>> 17); + + if (this.first) { + this.h0 = a + 1732584193 << 0; + this.h1 = b - 271733879 << 0; + this.h2 = c - 1732584194 << 0; + this.h3 = d + 271733878 << 0; + this.first = false; + } else { + this.h0 = this.h0 + a << 0; + this.h1 = this.h1 + b << 0; + this.h2 = this.h2 + c << 0; + this.h3 = this.h3 + d << 0; + } + }; + + /** + * @method hex + * @memberof Md4 + * @instance + * @description Output hash as hex string + * @returns {String} Hex string + * @see {@link md4.hex} + * @example + * hash.hex(); + */ + Md4.prototype.hex = function () { + this.finalize(); + + var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3; + + return HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] + + HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] + + HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] + + HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] + + HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] + + HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] + + HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] + + HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] + + HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] + + HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] + + HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] + + HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] + + HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] + + HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] + + HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] + + HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F]; + }; + + /** + * @method toString + * @memberof Md4 + * @instance + * @description Output hash as hex string + * @returns {String} Hex string + * @see {@link md4.hex} + * @example + * hash.toString(); + */ + Md4.prototype.toString = Md4.prototype.hex; + + /** + * @method digest + * @memberof Md4 + * @instance + * @description Output hash as bytes array + * @returns {Array} Bytes array + * @see {@link md4.digest} + * @example + * hash.digest(); + */ + Md4.prototype.digest = function() { + this.finalize(); + + var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3; + return [ + h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 24) & 0xFF, + h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 24) & 0xFF, + h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 24) & 0xFF, + h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 24) & 0xFF + ]; + }; + + /** + * @method array + * @memberof Md4 + * @instance + * @description Output hash as bytes array + * @returns {Array} Bytes array + * @see {@link md4.array} + * @example + * hash.array(); + */ + Md4.prototype.array = Md4.prototype.digest; + + /** + * @method arrayBuffer + * @memberof Md4 + * @instance + * @description Output hash as ArrayBuffer + * @returns {ArrayBuffer} ArrayBuffer + * @see {@link md4.arrayBuffer} + * @example + * hash.arrayBuffer(); + */ + Md4.prototype.arrayBuffer = function() { + this.finalize(); + + var buffer = new ArrayBuffer(16); + var blocks = new Uint32Array(buffer); + blocks[0] = this.h0; + blocks[1] = this.h1; + blocks[2] = this.h2; + blocks[3] = this.h3; + return buffer; + }; + + /** + * @method buffer + * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. + * @memberof Md4 + * @instance + * @description Output hash as ArrayBuffer + * @returns {ArrayBuffer} ArrayBuffer + * @see {@link md4.buffer} + * @example + * hash.buffer(); + */ + Md4.prototype.buffer = Md4.prototype.arrayBuffer; + + var exports = createMethod(); + + if (COMMON_JS) { + module.exports = exports; + } else { + /** + * @method md4 + * @description MD4 hash function, export to global in browsers. + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {String} md4 hashes + * @example + * md4(''); // 31d6cfe0d16ae931b73c59d7e0c089c0 + * md4('The quick brown fox jumps over the lazy dog'); // 1bee69a46ba811185c194762abaeae90 + * md4('The quick brown fox jumps over the lazy dog.'); // 2812c6c7136898c51f6f6739ad08750e + * + * // It also supports UTF-8 encoding + * md4('中文'); // 223088bf7bd45a16436b15360c5fc5a0 + * + * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` + * md4([]); // 31d6cfe0d16ae931b73c59d7e0c089c0 + * md4(new Uint8Array([])); // 31d6cfe0d16ae931b73c59d7e0c089c0 + */ + root.md4 = exports; + if (AMD) { + define(function () { + return exports; + }); + } + } +})(); + + +/***/ }), + +/***/ 9775: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./abs')} */ +module.exports = Math.abs; + + +/***/ }), + +/***/ 924: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./floor')} */ +module.exports = Math.floor; + + +/***/ }), + +/***/ 7661: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./isNaN')} */ +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; + + +/***/ }), + +/***/ 2419: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./max')} */ +module.exports = Math.max; + + +/***/ }), + +/***/ 3373: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./min')} */ +module.exports = Math.min; + + +/***/ }), + +/***/ 8029: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./pow')} */ +module.exports = Math.pow; + + +/***/ }), + +/***/ 9396: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./round')} */ +module.exports = Math.round; + + +/***/ }), + +/***/ 9091: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var $isNaN = __nccwpck_require__(7661); + +/** @type {import('./sign')} */ +module.exports = function sign(number) { + if ($isNaN(number) || number === 0) { + return number; + } + return number < 0 ? -1 : +1; +}; + + +/***/ }), + +/***/ 910: +/***/ ((module) => { + +module.exports = assert; + +function assert(val, msg) { + if (!val) + throw new Error(msg || 'Assertion failed'); +} + +assert.equal = function assertEqual(l, r, msg) { + if (l != r) + throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); +}; /***/ }), @@ -57417,11 +70719,24 @@ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; var booleanValueOf = Boolean.prototype.valueOf; var objectToString = Object.prototype.toString; var functionToString = Function.prototype.toString; -var match = String.prototype.match; +var $match = String.prototype.match; +var $slice = String.prototype.slice; +var $replace = String.prototype.replace; +var $toUpperCase = String.prototype.toUpperCase; +var $toLowerCase = String.prototype.toLowerCase; +var $test = RegExp.prototype.test; +var $concat = Array.prototype.concat; +var $join = Array.prototype.join; +var $arrSlice = Array.prototype.slice; +var $floor = Math.floor; var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; var gOPS = Object.getOwnPropertySymbols; var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; +// ie, `has-tostringtag/shams +var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') + ? Symbol.toStringTag + : null; var isEnumerable = Object.prototype.propertyIsEnumerable; var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( @@ -57432,14 +70747,47 @@ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPr : null ); -var inspectCustom = (__nccwpck_require__(7265).custom); -var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null; -var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null; +function addNumericSeparator(num, str) { + if ( + num === Infinity + || num === -Infinity + || num !== num + || (num && num > -1000 && num < 1000) + || $test.call(/e/, str) + ) { + return str; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === 'number') { + var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) + if (int !== num) { + var intStr = String(int); + var dec = $slice.call(str, intStr.length + 1); + return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); + } + } + return $replace.call(str, sepRegex, '$&_'); +} + +var utilInspect = __nccwpck_require__(7265); +var inspectCustom = utilInspect.custom; +var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; + +var quotes = { + __proto__: null, + 'double': '"', + single: "'" +}; +var quoteREs = { + __proto__: null, + 'double': /(["\\])/g, + single: /(['\\])/g +}; module.exports = function inspect_(obj, options, depth, seen) { var opts = options || {}; - if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { + if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) { throw new TypeError('option "quoteStyle" must be "single" or "double"'); } if ( @@ -57461,8 +70809,12 @@ module.exports = function inspect_(obj, options, depth, seen) { && opts.indent !== '\t' && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) ) { - throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`'); + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); } + var numericSeparator = opts.numericSeparator; if (typeof obj === 'undefined') { return 'undefined'; @@ -57481,10 +70833,12 @@ module.exports = function inspect_(obj, options, depth, seen) { if (obj === 0) { return Infinity / obj > 0 ? '0' : '-0'; } - return String(obj); + var str = String(obj); + return numericSeparator ? addNumericSeparator(obj, str) : str; } if (typeof obj === 'bigint') { - return String(obj) + 'n'; + var bigIntStr = String(obj) + 'n'; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; } var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; @@ -57503,7 +70857,7 @@ module.exports = function inspect_(obj, options, depth, seen) { function inspect(value, from, noIndent) { if (from) { - seen = seen.slice(); + seen = $arrSlice.call(seen); seen.push(from); } if (noIndent) { @@ -57518,24 +70872,24 @@ module.exports = function inspect_(obj, options, depth, seen) { return inspect_(value, opts, depth + 1, seen); } - if (typeof obj === 'function') { + if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable var name = nameOf(obj); var keys = arrObjKeys(obj, inspect); - return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : ''); + return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); } if (isSymbol(obj)) { - var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; } if (isElement(obj)) { - var s = '<' + String(obj.nodeName).toLowerCase(); + var s = '<' + $toLowerCase.call(String(obj.nodeName)); var attrs = obj.attributes || []; for (var i = 0; i < attrs.length; i++) { s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); } s += '>'; if (obj.childNodes && obj.childNodes.length) { s += '...'; } - s += ''; + s += ''; return s; } if (isArray(obj)) { @@ -57544,32 +70898,39 @@ module.exports = function inspect_(obj, options, depth, seen) { if (indent && !singleLineValues(xs)) { return '[' + indentedJoin(xs, indent) + ']'; } - return '[ ' + xs.join(', ') + ' ]'; + return '[ ' + $join.call(xs, ', ') + ' ]'; } if (isError(obj)) { var parts = arrObjKeys(obj, inspect); + if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { + return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; + } if (parts.length === 0) { return '[' + String(obj) + ']'; } - return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; + return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; } if (typeof obj === 'object' && customInspect) { - if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { - return obj[inspectSymbol](); + if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { + return utilInspect(obj, { depth: maxDepth - depth }); } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { return obj.inspect(); } } if (isMap(obj)) { var mapParts = []; - mapForEach.call(obj, function (value, key) { - mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); - }); + if (mapForEach) { + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); + }); + } return collectionOf('Map', mapSize.call(obj), mapParts, indent); } if (isSet(obj)) { var setParts = []; - setForEach.call(obj, function (value) { - setParts.push(inspect(value, obj)); - }); + if (setForEach) { + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + } return collectionOf('Set', setSize.call(obj), setParts, indent); } if (isWeakMap(obj)) { @@ -57593,38 +70954,53 @@ module.exports = function inspect_(obj, options, depth, seen) { if (isString(obj)) { return markBoxed(inspect(String(obj))); } + // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other + /* eslint-env browser */ + if (typeof window !== 'undefined' && obj === window) { + return '{ [object Window] }'; + } + if ( + (typeof globalThis !== 'undefined' && obj === globalThis) + || (typeof global !== 'undefined' && obj === global) + ) { + return '{ [object globalThis] }'; + } if (!isDate(obj) && !isRegExp(obj)) { var ys = arrObjKeys(obj, inspect); var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; var protoTag = obj instanceof Object ? '' : 'null prototype'; - var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : ''; + var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; - var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : ''); + var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); if (ys.length === 0) { return tag + '{}'; } if (indent) { return tag + '{' + indentedJoin(ys, indent) + '}'; } - return tag + '{ ' + ys.join(', ') + ' }'; + return tag + '{ ' + $join.call(ys, ', ') + ' }'; } return String(obj); }; function wrapQuotes(s, defaultStyle, opts) { - var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + var style = opts.quoteStyle || defaultStyle; + var quoteChar = quotes[style]; return quoteChar + s + quoteChar; } function quote(s) { - return String(s).replace(/"/g, '"'); + return $replace.call(String(s), /"/g, '"'); } -function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function canTrustToString(obj) { + return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined')); +} +function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); } +function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); } +function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); } +function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); } +function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); } +function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); } +function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); } // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives function isSymbol(obj) { @@ -57666,7 +71042,7 @@ function toStr(obj) { function nameOf(f) { if (f.name) { return f.name; } - var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/); + var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); if (m) { return m[1]; } return null; } @@ -57766,10 +71142,12 @@ function inspectString(str, opts) { if (str.length > opts.maxStringLength) { var remaining = str.length - opts.maxStringLength; var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); - return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer; + return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; } + var quoteRE = quoteREs[opts.quoteStyle || 'single']; + quoteRE.lastIndex = 0; // eslint-disable-next-line no-control-regex - var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); + var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte); return wrapQuotes(s, 'single', opts); } @@ -57783,7 +71161,7 @@ function lowbyte(c) { 13: 'r' }[n]; if (x) { return '\\' + x; } - return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase(); + return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); } function markBoxed(str) { @@ -57795,7 +71173,7 @@ function weakCollectionOf(type) { } function collectionOf(type, size, entries, indent) { - var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', '); + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); return type + ' (' + size + ') {' + joinedEntries + '}'; } @@ -57813,20 +71191,20 @@ function getIndent(opts, depth) { if (opts.indent === '\t') { baseIndent = '\t'; } else if (typeof opts.indent === 'number' && opts.indent > 0) { - baseIndent = Array(opts.indent + 1).join(' '); + baseIndent = $join.call(Array(opts.indent + 1), ' '); } else { return null; } return { base: baseIndent, - prev: Array(depth + 1).join(baseIndent) + prev: $join.call(Array(depth + 1), baseIndent) }; } function indentedJoin(xs, indent) { if (xs.length === 0) { return ''; } var lineJoiner = '\n' + indent.prev + indent.base; - return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev; + return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; } function arrObjKeys(obj, inspect) { @@ -57853,7 +71231,7 @@ function arrObjKeys(obj, inspect) { if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section continue; // eslint-disable-line no-restricted-syntax, no-continue - } else if ((/[^\w$]/).test(key)) { + } else if ($test.call(/[^\w$]/, key)) { xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); } else { xs.push(key + ': ' + inspect(obj[key], obj)); @@ -57866,2513 +71244,2854 @@ function arrObjKeys(obj, inspect) { } } } - return xs; -} + return xs; +} + + +/***/ }), + +/***/ 7265: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(3837).inspect; + + +/***/ }), + +/***/ 4907: +/***/ ((module) => { + +"use strict"; + + +var replace = String.prototype.replace; +var percentTwenties = /%20/g; + +var Format = { + RFC1738: 'RFC1738', + RFC3986: 'RFC3986' +}; + +module.exports = { + 'default': Format.RFC3986, + formatters: { + RFC1738: function (value) { + return replace.call(value, percentTwenties, '+'); + }, + RFC3986: function (value) { + return String(value); + } + }, + RFC1738: Format.RFC1738, + RFC3986: Format.RFC3986 +}; + + +/***/ }), + +/***/ 2760: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var stringify = __nccwpck_require__(9954); +var parse = __nccwpck_require__(3912); +var formats = __nccwpck_require__(4907); + +module.exports = { + formats: formats, + parse: parse, + stringify: stringify +}; + + +/***/ }), + +/***/ 3912: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var utils = __nccwpck_require__(2360); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +var defaults = { + allowDots: false, + allowEmptyArrays: false, + allowPrototypes: false, + allowSparse: false, + arrayLimit: 20, + charset: 'utf-8', + charsetSentinel: false, + comma: false, + decodeDotInKeys: false, + decoder: utils.decode, + delimiter: '&', + depth: 5, + duplicates: 'combine', + ignoreQueryPrefix: false, + interpretNumericEntities: false, + parameterLimit: 1000, + parseArrays: true, + plainObjects: false, + strictDepth: false, + strictNullHandling: false, + throwOnLimitExceeded: false +}; + +var interpretNumericEntities = function (str) { + return str.replace(/&#(\d+);/g, function ($0, numberStr) { + return String.fromCharCode(parseInt(numberStr, 10)); + }); +}; + +var parseArrayValue = function (val, options, currentArrayLength) { + if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { + return val.split(','); + } + + if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + + return val; +}; + +// This is what browsers will submit when the ✓ character occurs in an +// application/x-www-form-urlencoded body and the encoding of the page containing +// the form is iso-8859-1, or when the submitted form has an accept-charset +// attribute of iso-8859-1. Presumably also with other charsets that do not contain +// the ✓ character, such as us-ascii. +var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') + +// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. +var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') + +var parseValues = function parseQueryStringValues(str, options) { + var obj = { __proto__: null }; + + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + + var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; + var parts = cleanStr.split( + options.delimiter, + options.throwOnLimitExceeded ? limit + 1 : limit + ); + + if (options.throwOnLimitExceeded && parts.length > limit) { + throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.'); + } + + var skipIndex = -1; // Keep track of where the utf8 sentinel was found + var i; + + var charset = options.charset; + if (options.charsetSentinel) { + for (i = 0; i < parts.length; ++i) { + if (parts[i].indexOf('utf8=') === 0) { + if (parts[i] === charsetSentinel) { + charset = 'utf-8'; + } else if (parts[i] === isoSentinel) { + charset = 'iso-8859-1'; + } + skipIndex = i; + i = parts.length; // The eslint settings do not allow break; + } + } + } + + for (i = 0; i < parts.length; ++i) { + if (i === skipIndex) { + continue; + } + var part = parts[i]; + + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; + + var key; + var val; + if (pos === -1) { + key = options.decoder(part, defaults.decoder, charset, 'key'); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); + + val = utils.maybeMap( + parseArrayValue( + part.slice(pos + 1), + options, + isArray(obj[key]) ? obj[key].length : 0 + ), + function (encodedVal) { + return options.decoder(encodedVal, defaults.decoder, charset, 'value'); + } + ); + } + + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { + val = interpretNumericEntities(String(val)); + } + + if (part.indexOf('[]=') > -1) { + val = isArray(val) ? [val] : val; + } + + var existing = has.call(obj, key); + if (existing && options.duplicates === 'combine') { + obj[key] = utils.combine(obj[key], val); + } else if (!existing || options.duplicates === 'last') { + obj[key] = val; + } + } + + return obj; +}; + +var parseObject = function (chain, val, options, valuesParsed) { + var currentArrayLength = 0; + if (chain.length > 0 && chain[chain.length - 1] === '[]') { + var parentKey = chain.slice(0, -1).join(''); + currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0; + } + + var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength); + + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; + + if (root === '[]' && options.parseArrays) { + obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) + ? [] + : utils.combine([], leaf); + } else { + obj = options.plainObjects ? { __proto__: null } : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; + var index = parseInt(decodedRoot, 10); + if (!options.parseArrays && decodedRoot === '') { + obj = { 0: leaf }; + } else if ( + !isNaN(index) + && root !== decodedRoot + && String(index) === decodedRoot + && index >= 0 + && (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = leaf; + } else if (decodedRoot !== '__proto__') { + obj[decodedRoot] = leaf; + } + } + + leaf = obj; + } + return leaf; +}; -/***/ }), +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } -/***/ 7265: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; -module.exports = __nccwpck_require__(3837).inspect; + // The regex chunks + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; -/***/ }), + // Get the parent -/***/ 4334: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var segment = options.depth > 0 && brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; -"use strict"; + // Stash the parent if it exists + var keys = []; + if (parent) { + // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } -var GetIntrinsic = __nccwpck_require__(4538); -var callBound = __nccwpck_require__(8803); -var inspect = __nccwpck_require__(504); + keys.push(parent); + } -var $TypeError = GetIntrinsic('%TypeError%'); -var $WeakMap = GetIntrinsic('%WeakMap%', true); -var $Map = GetIntrinsic('%Map%', true); + // Loop through children appending to the array until we hit depth -var $weakMapGet = callBound('WeakMap.prototype.get', true); -var $weakMapSet = callBound('WeakMap.prototype.set', true); -var $weakMapHas = callBound('WeakMap.prototype.has', true); -var $mapGet = callBound('Map.prototype.get', true); -var $mapSet = callBound('Map.prototype.set', true); -var $mapHas = callBound('Map.prototype.has', true); + var i = 0; + while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } -/* - * This function traverses the list returning the node corresponding to the - * given key. - * - * That node is also moved to the head of the list, so that if it's accessed - * again we don't need to traverse the whole list. By doing so, all the recently - * used nodes can be accessed relatively quickly. - */ -var listGetNode = function (list, key) { // eslint-disable-line consistent-return - for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) { - if (curr.key === key) { - prev.next = curr.next; - curr.next = list.next; - list.next = curr; // eslint-disable-line no-param-reassign - return curr; - } - } -}; + // If there's a remainder, check strictDepth option for throw, else just add whatever is left -var listGet = function (objects, key) { - var node = listGetNode(objects, key); - return node && node.value; -}; -var listSet = function (objects, key, value) { - var node = listGetNode(objects, key); - if (node) { - node.value = value; - } else { - // Prepend the new node to the beginning of the list - objects.next = { // eslint-disable-line no-param-reassign - key: key, - next: objects.next, - value: value - }; - } -}; -var listHas = function (objects, key) { - return !!listGetNode(objects, key); -}; + if (segment) { + if (options.strictDepth === true) { + throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); + } + keys.push('[' + key.slice(segment.index) + ']'); + } -module.exports = function getSideChannel() { - var $wm; - var $m; - var $o; - var channel = { - assert: function (key) { - if (!channel.has(key)) { - throw new $TypeError('Side channel does not contain ' + inspect(key)); - } - }, - get: function (key) { // eslint-disable-line consistent-return - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) { - return $weakMapGet($wm, key); - } - } else if ($Map) { - if ($m) { - return $mapGet($m, key); - } - } else { - if ($o) { // eslint-disable-line no-lonely-if - return listGet($o, key); - } - } - }, - has: function (key) { - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) { - return $weakMapHas($wm, key); - } - } else if ($Map) { - if ($m) { - return $mapHas($m, key); - } - } else { - if ($o) { // eslint-disable-line no-lonely-if - return listHas($o, key); - } - } - return false; - }, - set: function (key, value) { - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if (!$wm) { - $wm = new $WeakMap(); - } - $weakMapSet($wm, key, value); - } else if ($Map) { - if (!$m) { - $m = new $Map(); - } - $mapSet($m, key, value); - } else { - if (!$o) { - /* - * Initialize the linked list as an empty node, so that we don't have - * to special-case handling of the first node: we can always refer to - * it as (previous node).next, instead of something like (list).head - */ - $o = { key: {}, next: null }; - } - listSet($o, key, value); - } - } - }; - return channel; + return parseObject(keys, val, options, valuesParsed); }; +var normalizeParseOptions = function normalizeParseOptions(opts) { + if (!opts) { + return defaults; + } -/***/ }), - -/***/ 4294: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = __nccwpck_require__(4219); - - -/***/ }), - -/***/ 4219: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } -var net = __nccwpck_require__(1808); -var tls = __nccwpck_require__(4404); -var http = __nccwpck_require__(3685); -var https = __nccwpck_require__(5687); -var events = __nccwpck_require__(2361); -var assert = __nccwpck_require__(9491); -var util = __nccwpck_require__(3837); + if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { + throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); + } + if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } -exports.httpOverHttp = httpOverHttp; -exports.httpsOverHttp = httpsOverHttp; -exports.httpOverHttps = httpOverHttps; -exports.httpsOverHttps = httpsOverHttps; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') { + throw new TypeError('`throwOnLimitExceeded` option must be a boolean'); + } -function httpOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - return agent; -} + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; -function httpsOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; -} + var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; -function httpOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - return agent; -} + if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { + throw new TypeError('The duplicates option must be either combine, first, or last'); + } -function httpsOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; -} + var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + return { + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, + // eslint-disable-next-line no-implicit-coercion, no-extra-parens + depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, + duplicates: duplicates, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, + throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false + }; +}; -function TunnelingAgent(options) { - var self = this; - self.options = options || {}; - self.proxyOptions = self.options.proxy || {}; - self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; - self.requests = []; - self.sockets = []; +module.exports = function (str, opts) { + var options = normalizeParseOptions(opts); - self.on('free', function onFree(socket, host, port, localAddress) { - var options = toOptions(host, port, localAddress); - for (var i = 0, len = self.requests.length; i < len; ++i) { - var pending = self.requests[i]; - if (pending.host === options.host && pending.port === options.port) { - // Detect the request to connect same origin server, - // reuse the connection. - self.requests.splice(i, 1); - pending.request.onSocket(socket); - return; - } + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? { __proto__: null } : {}; } - socket.destroy(); - self.removeSocket(socket); - }); -} -util.inherits(TunnelingAgent, events.EventEmitter); - -TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { - var self = this; - var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); - if (self.sockets.length >= this.maxSockets) { - // We are over limit so we'll add it to the queue. - self.requests.push(options); - return; - } + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? { __proto__: null } : {}; - // If we are under maxSockets create a new one. - self.createSocket(options, function(socket) { - socket.on('free', onFree); - socket.on('close', onCloseOrRemove); - socket.on('agentRemove', onCloseOrRemove); - req.onSocket(socket); + // Iterate over the keys and setup the new object - function onFree() { - self.emit('free', socket, options); + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); + obj = utils.merge(obj, newObj, options); } - function onCloseOrRemove(err) { - self.removeSocket(socket); - socket.removeListener('free', onFree); - socket.removeListener('close', onCloseOrRemove); - socket.removeListener('agentRemove', onCloseOrRemove); + if (options.allowSparse === true) { + return obj; } - }); + + return utils.compact(obj); }; -TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { - var self = this; - var placeholder = {}; - self.sockets.push(placeholder); - var connectOptions = mergeOptions({}, self.proxyOptions, { - method: 'CONNECT', - path: options.host + ':' + options.port, - agent: false, - headers: { - host: options.host + ':' + options.port - } - }); - if (options.localAddress) { - connectOptions.localAddress = options.localAddress; - } - if (connectOptions.proxyAuth) { - connectOptions.headers = connectOptions.headers || {}; - connectOptions.headers['Proxy-Authorization'] = 'Basic ' + - new Buffer(connectOptions.proxyAuth).toString('base64'); - } +/***/ }), - debug('making CONNECT request'); - var connectReq = self.request(connectOptions); - connectReq.useChunkedEncodingByDefault = false; // for v0.6 - connectReq.once('response', onResponse); // for v0.6 - connectReq.once('upgrade', onUpgrade); // for v0.6 - connectReq.once('connect', onConnect); // for v0.7 or later - connectReq.once('error', onError); - connectReq.end(); +/***/ 9954: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - function onResponse(res) { - // Very hacky. This is necessary to avoid http-parser leaks. - res.upgrade = true; - } +"use strict"; - function onUpgrade(res, socket, head) { - // Hacky. - process.nextTick(function() { - onConnect(res, socket, head); - }); - } - function onConnect(res, socket, head) { - connectReq.removeAllListeners(); - socket.removeAllListeners(); +var getSideChannel = __nccwpck_require__(4334); +var utils = __nccwpck_require__(2360); +var formats = __nccwpck_require__(4907); +var has = Object.prototype.hasOwnProperty; - if (res.statusCode !== 200) { - debug('tunneling socket could not be established, statusCode=%d', - res.statusCode); - socket.destroy(); - var error = new Error('tunneling socket could not be established, ' + - 'statusCode=' + res.statusCode); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - return; - } - if (head.length > 0) { - debug('got illegal response body from proxy'); - socket.destroy(); - var error = new Error('got illegal response body from proxy'); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - return; +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + comma: 'comma', + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; } - debug('tunneling connection has established'); - self.sockets[self.sockets.indexOf(placeholder)] = socket; - return cb(socket); - } - - function onError(cause) { - connectReq.removeAllListeners(); +}; - debug('tunneling socket could not be established, cause=%s\n', - cause.message, cause.stack); - var error = new Error('tunneling socket could not be established, ' + - 'cause=' + cause.message); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - } +var isArray = Array.isArray; +var push = Array.prototype.push; +var pushToArray = function (arr, valueOrArray) { + push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); }; -TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { - var pos = this.sockets.indexOf(socket) - if (pos === -1) { - return; - } - this.sockets.splice(pos, 1); +var toISO = Date.prototype.toISOString; - var pending = this.requests.shift(); - if (pending) { - // If we have pending requests and a socket gets closed a new one - // needs to be created to take over in the pool for the one that closed. - this.createSocket(pending, function(socket) { - pending.request.onSocket(socket); - }); - } +var defaultFormat = formats['default']; +var defaults = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: 'indices', + charset: 'utf-8', + charsetSentinel: false, + commaRoundTrip: false, + delimiter: '&', + encode: true, + encodeDotInKeys: false, + encoder: utils.encode, + encodeValuesOnly: false, + filter: void undefined, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + // deprecated + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false }; -function createSecureSocket(options, cb) { - var self = this; - TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { - var hostHeader = options.request.getHeader('host'); - var tlsOptions = mergeOptions({}, self.options, { - socket: socket, - servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host - }); - - // 0 is dummy port for v0.6 - var secureSocket = tls.connect(0, tlsOptions); - self.sockets[self.sockets.indexOf(socket)] = secureSocket; - cb(secureSocket); - }); -} +var isNonNullishPrimitive = function isNonNullishPrimitive(v) { + return typeof v === 'string' + || typeof v === 'number' + || typeof v === 'boolean' + || typeof v === 'symbol' + || typeof v === 'bigint'; +}; +var sentinel = {}; -function toOptions(host, port, localAddress) { - if (typeof host === 'string') { // since v0.10 - return { - host: host, - port: port, - localAddress: localAddress - }; - } - return host; // for v0.11 or later -} +var stringify = function stringify( + object, + prefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + sideChannel +) { + var obj = object; -function mergeOptions(target) { - for (var i = 1, len = arguments.length; i < len; ++i) { - var overrides = arguments[i]; - if (typeof overrides === 'object') { - var keys = Object.keys(overrides); - for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { - var k = keys[j]; - if (overrides[k] !== undefined) { - target[k] = overrides[k]; + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { + // Where object last appeared in the ref tree + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== 'undefined') { + if (pos === step) { + throw new RangeError('Cyclic object value'); + } else { + findFlag = true; // Break while + } + } + if (typeof tmpSc.get(sentinel) === 'undefined') { + step = 0; } - } } - } - return target; -} - -var debug; -if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - var args = Array.prototype.slice.call(arguments); - if (typeof args[0] === 'string') { - args[0] = 'TUNNEL: ' + args[0]; - } else { - args.unshift('TUNNEL:'); + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === 'comma' && isArray(obj)) { + obj = utils.maybeMap(obj, function (value) { + if (value instanceof Date) { + return serializeDate(value); + } + return value; + }); } - console.error.apply(console, args); - } -} else { - debug = function() {}; -} -exports.debug = debug; // for test - -/***/ }), + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; + } -/***/ 9026: -/***/ ((__unused_webpack_module, exports) => { + obj = ''; + } -"use strict"; + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -// Used by buildProxyBypassRegexFromEnv for escaping dot symbols in NO_PROXY hosts' strings -exports.searchRegExpToReplaceSpecialChars = new RegExp('(? 0 ? obj.join(',') || null : void undefined }]; + } else if (isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } -/***/ 4442: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); -"use strict"; + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; -Object.defineProperty(exports, "__esModule", ({ value: true })); -var basiccreds_1 = __nccwpck_require__(7954); -exports.BasicCredentialHandler = basiccreds_1.BasicCredentialHandler; -var bearertoken_1 = __nccwpck_require__(7431); -exports.BearerCredentialHandler = bearertoken_1.BearerCredentialHandler; -var ntlm_1 = __nccwpck_require__(4157); -exports.NtlmCredentialHandler = ntlm_1.NtlmCredentialHandler; -var personalaccesstoken_1 = __nccwpck_require__(7799); -exports.PersonalAccessTokenCredentialHandler = personalaccesstoken_1.PersonalAccessTokenCredentialHandler; + if (allowEmptyArrays && isArray(obj) && obj.length === 0) { + return adjustedPrefix + '[]'; + } + for (var j = 0; j < objKeys.length; ++j) { + var key = objKeys[j]; + var value = typeof key === 'object' && key && typeof key.value !== 'undefined' + ? key.value + : obj[key]; -/***/ }), + if (skipNulls && value === null) { + continue; + } -/***/ 5538: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); + var keyPrefix = isArray(obj) + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix + : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); -"use strict"; + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify( + value, + keyPrefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel + )); + } -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + return values; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const url = __nccwpck_require__(7310); -const http = __nccwpck_require__(3685); -const https = __nccwpck_require__(5687); -const util = __nccwpck_require__(9470); -let fs; -let tunnel; -var HttpCodes; -(function (HttpCodes) { - HttpCodes[HttpCodes["OK"] = 200] = "OK"; - HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; - HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; - HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; - HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; - HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; - HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; - HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; - HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; - HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; - HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); -const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect]; -const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout]; -const NetworkRetryErrors = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED']; -const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; -const ExponentialBackoffCeiling = 10; -const ExponentialBackoffTimeSlice = 5; -class HttpClientResponse { - constructor(message) { - this.message = message; - } - readBody() { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let buffer = Buffer.alloc(0); - const encodingCharset = util.obtainContentCharset(this); - // Extract Encoding from header: 'content-encoding' - // Match `gzip`, `gzip, deflate` variations of GZIP encoding - const contentEncoding = this.message.headers['content-encoding'] || ''; - const isGzippedEncoded = new RegExp('(gzip$)|(gzip, *deflate)').test(contentEncoding); - this.message.on('data', function (data) { - const chunk = (typeof data === 'string') ? Buffer.from(data, encodingCharset) : data; - buffer = Buffer.concat([buffer, chunk]); - }).on('end', function () { - return __awaiter(this, void 0, void 0, function* () { - if (isGzippedEncoded) { // Process GZipped Response Body HERE - const gunzippedBody = yield util.decompressGzippedContent(buffer, encodingCharset); - resolve(gunzippedBody); - } - else { - resolve(buffer.toString(encodingCharset)); - } - }); - }).on('error', function (err) { - reject(err); - }); - })); + +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { + if (!opts) { + return defaults; } -} -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { - let parsedUrl = url.parse(requestUrl); - return parsedUrl.protocol === 'https:'; -} -exports.isHttps = isHttps; -var EnvironmentVariables; -(function (EnvironmentVariables) { - EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY"; - EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY"; - EnvironmentVariables["NO_PROXY"] = "NO_PROXY"; -})(EnvironmentVariables || (EnvironmentVariables = {})); -class HttpClient { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - let no_proxy = process.env[EnvironmentVariables.NO_PROXY]; - if (no_proxy) { - this._httpProxyBypassHosts = []; - no_proxy.split(',').forEach(bypass => { - this._httpProxyBypassHosts.push(util.buildProxyBypassRegexFromEnv(bypass)); - }); - } - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - this._httpProxy = requestOptions.proxy; - if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) { - this._httpProxyBypassHosts = []; - requestOptions.proxy.proxyBypassHosts.forEach(bypass => { - this._httpProxyBypassHosts.push(new RegExp(bypass, 'i')); - }); - } - this._certConfig = requestOptions.cert; - if (this._certConfig) { - // If using cert, need fs - fs = __nccwpck_require__(7147); - // cache the cert content into memory, so we don't have to read it from disk every time - if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) { - this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8'); - } - if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) { - this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8'); - } - if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) { - this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8'); - } - } - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); } - options(requestUrl, additionalHeaders) { - return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + + if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { + throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); } - get(requestUrl, additionalHeaders) { - return this.request('GET', requestUrl, null, additionalHeaders || {}); + + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); } - del(requestUrl, additionalHeaders) { - return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + + var charset = opts.charset || defaults.charset; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); } - post(requestUrl, data, additionalHeaders) { - return this.request('POST', requestUrl, data, additionalHeaders || {}); + + var format = formats['default']; + if (typeof opts.format !== 'undefined') { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + format = opts.format; } - patch(requestUrl, data, additionalHeaders) { - return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + var formatter = formats.formatters[format]; + + var filter = defaults.filter; + if (typeof opts.filter === 'function' || isArray(opts.filter)) { + filter = opts.filter; } - put(requestUrl, data, additionalHeaders) { - return this.request('PUT', requestUrl, data, additionalHeaders || {}); + + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ('indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = defaults.arrayFormat; } - head(requestUrl, additionalHeaders) { - return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + + if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return this.request(verb, requestUrl, stream, additionalHeaders); + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat: arrayFormat, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: !!opts.commaRoundTrip, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + format: format, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (isArray(options.filter)) { + filter = options.filter; + objKeys = filter; } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - let parsedUrl = url.parse(requestUrl); - let info = this._prepareRequest(verb, parsedUrl, headers); - // Only perform retries on reads since writes may not be idempotent. - let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1; - let numTries = 0; - let response; - while (numTries < maxTries) { - try { - response = yield this.requestRaw(info, data); - } - catch (err) { - numTries++; - if (err && err.code && NetworkRetryErrors.indexOf(err.code) > -1 && numTries < maxTries) { - yield this._performExponentialBackoff(numTries); - continue; - } - throw err; - } - // Check if it's an authentication challenge - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (let i = 0; i < this.handlers.length; i++) { - if (this.handlers[i].canHandleAuthentication(response)) { - authenticationHandler = this.handlers[i]; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); - } - else { - // We have received an unauthorized response but have no handlers to handle it. - // Let the response return to the caller. - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 - && this._allowRedirects - && redirectsRemaining > 0) { - const redirectUrl = response.message.headers["location"]; - if (!redirectUrl) { - // if there's no location to redirect to, we won't - break; - } - let parsedRedirectUrl = url.parse(redirectUrl); - if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { - throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); - } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - yield response.readBody(); - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info, data); - redirectsRemaining--; - } - if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { - // If not a retry code, return immediately instead of retrying - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } - return response; - }); + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; + + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; + + if (!objKeys) { + objKeys = Object.keys(obj); } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info, data) { - return new Promise((resolve, reject) => { - let callbackForResult = function (err, res) { - if (err) { - reject(err); - } - resolve(res); - }; - this.requestRawWithCallback(info, data, callbackForResult); - }); + + if (options.sort) { + objKeys.sort(options.sort); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info, data, onResult) { - let socket; - if (typeof (data) === 'string') { - info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8'); - } - let callbackCalled = false; - let handleResult = (err, res) => { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - }; - let req = info.httpModule.request(info.options, (msg) => { - let res = new HttpClientResponse(msg); - handleResult(null, res); - }); - req.on('socket', (sock) => { - socket = sock; - }); - // If we ever get disconnected, we want the socket to timeout eventually - req.setTimeout(this._socketTimeout || 3 * 60000, () => { - if (socket) { - socket.destroy(); - } - handleResult(new Error('Request timeout: ' + info.options.path), null); - }); - req.on('error', function (err) { - // err has statusCode property - // res should have headers - handleResult(err, null); - }); - if (data && typeof (data) === 'string') { - req.write(data, 'utf8'); - } - if (data && typeof (data) !== 'string') { - data.on('close', function () { - req.end(); - }); - data.pipe(req); - } - else { - req.end(); + + var sideChannel = getSideChannel(); + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + var value = obj[key]; + + if (options.skipNulls && value === null) { + continue; } + pushToArray(keys, stringify( + value, + key, + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel + )); } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = requestUrl; - const usingSsl = info.parsedUrl.protocol === 'https:'; - info.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info.options = {}; - info.options.host = info.parsedUrl.hostname; - info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; - info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); - info.options.method = method; - info.options.timeout = (this.requestOptions && this.requestOptions.socketTimeout) || this._socketTimeout; - this._socketTimeout = info.options.timeout; - info.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info.options.headers["user-agent"] = this.userAgent; - } - info.options.agent = this._getAgent(info.parsedUrl); - // gives handlers an opportunity to participate - if (this.handlers && !this._isPresigned(url.format(requestUrl))) { - this.handlers.forEach((handler) => { - handler.prepareRequest(info.options); - }); + + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark + prefix += 'utf8=%26%2310003%3B&'; + } else { + // encodeURIComponent('✓') + prefix += 'utf8=%E2%9C%93&'; } - return info; } - _isPresigned(requestUrl) { - if (this.requestOptions && this.requestOptions.presignedUrlPatterns) { - const patterns = this.requestOptions.presignedUrlPatterns; - for (let i = 0; i < patterns.length; i++) { - if (requestUrl.match(patterns[i])) { - return true; + + return joined.length > 0 ? prefix + joined : ''; +}; + + +/***/ }), + +/***/ 2360: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var formats = __nccwpck_require__(4907); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } + + return array; +}()); + +var compactQueue = function compactQueue(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + + if (isArray(obj)) { + var compacted = []; + + for (var j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted.push(obj[j]); } } + + item.obj[item.prop] = compacted; } - return false; } - _mergeHeaders(headers) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); +}; + +var arrayToObject = function arrayToObject(source, options) { + var obj = options && options.plainObjects ? { __proto__: null } : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; } - return lowercaseKeys(headers || {}); } - _getAgent(parsedUrl) { - let agent; - let proxy = this._getProxy(parsedUrl); - let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isMatchInBypassProxyList(parsedUrl); - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (this._keepAlive && !useProxy) { - agent = this._agent; - } - // if agent is already assigned use that agent. - if (!!agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === 'https:'; - let maxSockets = 100; - if (!!this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (useProxy) { - // If using proxy, need tunnel - if (!tunnel) { - tunnel = __nccwpck_require__(4294); - } - const agentOptions = { - maxSockets: maxSockets, - keepAlive: this._keepAlive, - proxy: { - proxyAuth: proxy.proxyAuth, - host: proxy.proxyUrl.hostname, - port: proxy.proxyUrl.port - }, - }; - let tunnelAgent; - const overHttps = proxy.proxyUrl.protocol === 'https:'; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } - else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; - } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } - if (usingSsl && this._ignoreSslError) { - // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process - // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options - // we have to cast it to any and change it directly - agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); - } - if (usingSsl && this._certConfig) { - agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase }); - } - return agent; + + return obj; +}; + +var merge = function merge(target, source, options) { + /* eslint no-param-reassign: 0 */ + if (!source) { + return target; } - _getProxy(parsedUrl) { - let usingSsl = parsedUrl.protocol === 'https:'; - let proxyConfig = this._httpProxy; - // fallback to http_proxy and https_proxy env - let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY]; - let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY]; - if (!proxyConfig) { - if (https_proxy && usingSsl) { - proxyConfig = { - proxyUrl: https_proxy - }; - } - else if (http_proxy) { - proxyConfig = { - proxyUrl: http_proxy - }; - } - } - let proxyUrl; - let proxyAuth; - if (proxyConfig) { - if (proxyConfig.proxyUrl.length > 0) { - proxyUrl = url.parse(proxyConfig.proxyUrl); - } - if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) { - proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword; + + if (typeof source !== 'object' && typeof source !== 'function') { + if (isArray(target)) { + target.push(source); + } else if (target && typeof target === 'object') { + if ( + (options && (options.plainObjects || options.allowPrototypes)) + || !has.call(Object.prototype, source) + ) { + target[source] = true; } + } else { + return [target, source]; } - return { proxyUrl: proxyUrl, proxyAuth: proxyAuth }; - } - _isMatchInBypassProxyList(parsedUrl) { - if (!this._httpProxyBypassHosts) { - return false; - } - let bypass = false; - this._httpProxyBypassHosts.forEach(bypassHost => { - if (bypassHost.test(parsedUrl.href)) { - bypass = true; - } - }); - return bypass; + + return target; } - _performExponentialBackoff(retryNumber) { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise(resolve => setTimeout(() => resolve(), ms)); + + if (!target || typeof target !== 'object') { + return [target].concat(source); } -} -exports.HttpClient = HttpClient; + var mergeTarget = target; + if (isArray(target) && !isArray(source)) { + mergeTarget = arrayToObject(target, options); + } -/***/ }), + if (isArray(target) && isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + var targetItem = target[i]; + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } -/***/ 7405: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; -"use strict"; + if (has.call(acc, key)) { + acc[key] = merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); +var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function (acc, key) { + acc[key] = source[key]; + return acc; + }, target); }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const httpm = __nccwpck_require__(5538); -const util = __nccwpck_require__(9470); -class RestClient { - /** - * Creates an instance of the RestClient - * @constructor - * @param {string} userAgent - userAgent for requests - * @param {string} baseUrl - (Optional) If not specified, use full urls per request. If supplied and a function passes a relative url, it will be appended to this - * @param {ifm.IRequestHandler[]} handlers - handlers are typically auth handlers (basic, bearer, ntlm supplied) - * @param {ifm.IRequestOptions} requestOptions - options for each http requests (http proxy setting, socket timeout) - */ - constructor(userAgent, baseUrl, handlers, requestOptions) { - this.client = new httpm.HttpClient(userAgent, handlers, requestOptions); - if (baseUrl) { - this._baseUrl = baseUrl; - } - } - /** - * Gets a resource from an endpoint - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} requestUrl - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - options(requestUrl, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(requestUrl, this._baseUrl); - let res = yield this.client.options(url, this._headersFromOptions(options)); - return this.processResponse(res, options); - }); - } - /** - * Gets a resource from an endpoint - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified url or relative path - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - get(resource, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(resource, this._baseUrl, (options || {}).queryParameters); - let res = yield this.client.get(url, this._headersFromOptions(options)); - return this.processResponse(res, options); - }); - } - /** - * Deletes a resource from an endpoint - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - del(resource, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(resource, this._baseUrl, (options || {}).queryParameters); - let res = yield this.client.del(url, this._headersFromOptions(options)); - return this.processResponse(res, options); - }); + +var decode = function (str, defaultDecoder, charset) { + var strWithoutPlus = str.replace(/\+/g, ' '); + if (charset === 'iso-8859-1') { + // unescape never throws, no try...catch needed: + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); } - /** - * Creates resource(s) from an endpoint - * T type of object returned. - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - create(resource, resources, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(resource, this._baseUrl); - let headers = this._headersFromOptions(options, true); - let data = JSON.stringify(resources, null, 2); - let res = yield this.client.post(url, data, headers); - return this.processResponse(res, options); - }); + // utf-8 + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; } - /** - * Updates resource(s) from an endpoint - * T type of object returned. - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - update(resource, resources, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(resource, this._baseUrl); - let headers = this._headersFromOptions(options, true); - let data = JSON.stringify(resources, null, 2); - let res = yield this.client.patch(url, data, headers); - return this.processResponse(res, options); - }); +}; + +var limit = 1024; + +/* eslint operator-linebreak: [2, "before"] */ + +var encode = function encode(str, defaultEncoder, charset, kind, format) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; } - /** - * Replaces resource(s) from an endpoint - * T type of object returned. - * Be aware that not found returns a null. Other error conditions reject the promise - * @param {string} resource - fully qualified or relative url - * @param {IRequestOptions} requestOptions - (optional) requestOptions object - */ - replace(resource, resources, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(resource, this._baseUrl); - let headers = this._headersFromOptions(options, true); - let data = JSON.stringify(resources, null, 2); - let res = yield this.client.put(url, data, headers); - return this.processResponse(res, options); - }); + + var string = str; + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); } - uploadStream(verb, requestUrl, stream, options) { - return __awaiter(this, void 0, void 0, function* () { - let url = util.getUrl(requestUrl, this._baseUrl); - let headers = this._headersFromOptions(options, true); - let res = yield this.client.sendStream(verb, url, stream, headers); - return this.processResponse(res, options); + + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; }); } - _headersFromOptions(options, contentType) { - options = options || {}; - let headers = options.additionalHeaders || {}; - headers["Accept"] = options.acceptHeader || "application/json"; - if (contentType) { - let found = false; - for (let header in headers) { - if (header.toLowerCase() == "content-type") { - found = true; - } + + var out = ''; + for (var j = 0; j < string.length; j += limit) { + var segment = string.length >= limit ? string.slice(j, j + limit) : string; + var arr = []; + + for (var i = 0; i < segment.length; ++i) { + var c = segment.charCodeAt(i); + if ( + c === 0x2D // - + || c === 0x2E // . + || c === 0x5F // _ + || c === 0x7E // ~ + || (c >= 0x30 && c <= 0x39) // 0-9 + || (c >= 0x41 && c <= 0x5A) // a-z + || (c >= 0x61 && c <= 0x7A) // A-Z + || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) + ) { + arr[arr.length] = segment.charAt(i); + continue; } - if (!found) { - headers["Content-Type"] = 'application/json; charset=utf-8'; + + if (c < 0x80) { + arr[arr.length] = hexTable[c]; + continue; + } + + if (c < 0x800) { + arr[arr.length] = hexTable[0xC0 | (c >> 6)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + arr[arr.length] = hexTable[0xE0 | (c >> 12)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + continue; } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); + + arr[arr.length] = hexTable[0xF0 | (c >> 18)] + + hexTable[0x80 | ((c >> 12) & 0x3F)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; } - return headers; + + out += arr.join(''); } - static dateTimeDeserializer(key, value) { - if (typeof value === 'string') { - let a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; + + return out; +}; + +var compact = function compact(value) { + var queue = [{ obj: { o: value }, prop: 'o' }]; + var refs = []; + + for (var i = 0; i < queue.length; ++i) { + var item = queue[i]; + var obj = item.obj[item.prop]; + + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var val = obj[key]; + if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { + queue.push({ obj: obj, prop: key }); + refs.push(val); } } - return value; } - processResponse(res, options) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode; - const response = { - statusCode: statusCode, - result: null, - headers: {} - }; - // not found leads to null obj returned - if (statusCode == httpm.HttpCodes.NotFound) { - resolve(response); - } - let obj; - let contents; - // get the result from the body - try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, RestClient.dateTimeDeserializer); - } - else { - obj = JSON.parse(contents); - } - if (options && options.responseProcessor) { - response.result = options.responseProcessor(obj); - } - else { - response.result = obj; - } - } - response.headers = res.message.headers; - } - catch (err) { - // Invalid resource (contents not json); leaving result obj null - } - // note that 3xx redirects are handled by the http layer. - if (statusCode > 299) { - let msg; - // if exception/error in body, attempt to get better error - if (obj && obj.message) { - msg = obj.message; - } - else if (contents && contents.length > 0) { - // it may be the case that the exception is in the body message as string - msg = contents; - } - else { - msg = "Failed request: (" + statusCode + ")"; - } - let err = new Error(msg); - // attach statusCode and body obj (if available) to the error object - err['statusCode'] = statusCode; - if (response.result) { - err['result'] = response.result; - } - reject(err); - } - else { - resolve(response); - } - })); - }); + + compactQueue(queue); + + return value; +}; + +var isRegExp = function isRegExp(obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +var isBuffer = function isBuffer(obj) { + if (!obj || typeof obj !== 'object') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; + +var combine = function combine(a, b) { + return [].concat(a, b); +}; + +var maybeMap = function maybeMap(val, fn) { + if (isArray(val)) { + var mapped = []; + for (var i = 0; i < val.length; i += 1) { + mapped.push(fn(val[i])); + } + return mapped; } -} -exports.RestClient = RestClient; + return fn(val); +}; + +module.exports = { + arrayToObject: arrayToObject, + assign: assign, + combine: combine, + compact: compact, + decode: decode, + encode: encode, + isBuffer: isBuffer, + isRegExp: isRegExp, + maybeMap: maybeMap, + merge: merge +}; /***/ }), -/***/ 9470: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 8206: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + +var inspect = __nccwpck_require__(504); + +var $TypeError = __nccwpck_require__(6361); + +/* +* This function traverses the list returning the node corresponding to the given key. +* +* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. +* By doing so, all the recently used nodes can be accessed relatively quickly. +*/ +/** @type {import('./list.d.ts').listGetNode} */ +// eslint-disable-next-line consistent-return +var listGetNode = function (list, key, isDelete) { + /** @type {typeof list | NonNullable<(typeof list)['next']>} */ + var prev = list; + /** @type {(typeof list)['next']} */ + var curr; + // eslint-disable-next-line eqeqeq + for (; (curr = prev.next) != null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + if (!isDelete) { + // eslint-disable-next-line no-extra-parens + curr.next = /** @type {NonNullable} */ (list.next); + list.next = curr; // eslint-disable-line no-param-reassign + } + return curr; + } + } +}; + +/** @type {import('./list.d.ts').listGet} */ +var listGet = function (objects, key) { + if (!objects) { + return void undefined; + } + var node = listGetNode(objects, key); + return node && node.value; +}; +/** @type {import('./list.d.ts').listSet} */ +var listSet = function (objects, key, value) { + var node = listGetNode(objects, key); + if (node) { + node.value = value; + } else { + // Prepend the new node to the beginning of the list + objects.next = /** @type {import('./list.d.ts').ListNode} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens + key: key, + next: objects.next, + value: value + }); + } +}; +/** @type {import('./list.d.ts').listHas} */ +var listHas = function (objects, key) { + if (!objects) { + return false; + } + return !!listGetNode(objects, key); +}; +/** @type {import('./list.d.ts').listDelete} */ +// eslint-disable-next-line consistent-return +var listDelete = function (objects, key) { + if (objects) { + return listGetNode(objects, key, true); + } +}; + +/** @type {import('.')} */ +module.exports = function getSideChannelList() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {import('./list.d.ts').RootNode | undefined} */ var $o; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + var root = $o && $o.next; + var deletedNode = listDelete($o, key); + if (deletedNode && root && root === deletedNode) { + $o = void undefined; + } + return !!deletedNode; + }, + get: function (key) { + return listGet($o, key); + }, + has: function (key) { + return listHas($o, key); + }, + set: function (key, value) { + if (!$o) { + // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head + $o = { + next: void undefined + }; + } + // eslint-disable-next-line no-extra-parens + listSet(/** @type {NonNullable} */ ($o), key, value); + } + }; + // @ts-expect-error TODO: figure out why this is erroring + return channel; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const qs = __nccwpck_require__(9615); -const url = __nccwpck_require__(7310); -const path = __nccwpck_require__(1017); -const zlib = __nccwpck_require__(9796); -const Constants_1 = __nccwpck_require__(9026); -/** - * creates an url from a request url and optional base url (http://server:8080) - * @param {string} resource - a fully qualified url or relative path - * @param {string} baseUrl - an optional baseUrl (http://server:8080) - * @param {IRequestOptions} options - an optional options object, could include QueryParameters e.g. - * @return {string} - resultant url - */ -function getUrl(resource, baseUrl, queryParams) { - const pathApi = path.posix || path; - let requestUrl = ''; - if (!baseUrl) { - requestUrl = resource; - } - else if (!resource) { - requestUrl = baseUrl; - } - else { - const base = url.parse(baseUrl); - const resultantUrl = url.parse(resource); - // resource (specific per request) elements take priority - resultantUrl.protocol = resultantUrl.protocol || base.protocol; - resultantUrl.auth = resultantUrl.auth || base.auth; - resultantUrl.host = resultantUrl.host || base.host; - resultantUrl.pathname = pathApi.resolve(base.pathname, resultantUrl.pathname); - if (!resultantUrl.pathname.endsWith('/') && resource.endsWith('/')) { - resultantUrl.pathname += '/'; - } - requestUrl = url.format(resultantUrl); - } - return queryParams ? - getUrlWithParsedQueryParams(requestUrl, queryParams) : - requestUrl; -} -exports.getUrl = getUrl; -/** - * - * @param {string} requestUrl - * @param {IRequestQueryParams} queryParams - * @return {string} - Request's URL with Query Parameters appended/parsed. - */ -function getUrlWithParsedQueryParams(requestUrl, queryParams) { - const url = requestUrl.replace(/\?$/g, ''); // Clean any extra end-of-string "?" character - const parsedQueryParams = qs.stringify(queryParams.params, buildParamsStringifyOptions(queryParams)); - return `${url}${parsedQueryParams}`; -} -/** - * Build options for QueryParams Stringifying. - * - * @param {IRequestQueryParams} queryParams - * @return {object} - */ -function buildParamsStringifyOptions(queryParams) { - let options = { - addQueryPrefix: true, - delimiter: (queryParams.options || {}).separator || '&', - allowDots: (queryParams.options || {}).shouldAllowDots || false, - arrayFormat: (queryParams.options || {}).arrayFormat || 'repeat', - encodeValuesOnly: (queryParams.options || {}).shouldOnlyEncodeValues || true - }; - return options; -} -/** - * Decompress/Decode gzip encoded JSON - * Using Node.js built-in zlib module - * - * @param {Buffer} buffer - * @param {string} charset? - optional; defaults to 'utf-8' - * @return {Promise} - */ -function decompressGzippedContent(buffer, charset) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - zlib.gunzip(buffer, function (error, buffer) { - if (error) { - reject(error); - } - resolve(buffer.toString(charset || 'utf-8')); - }); - })); - }); -} -exports.decompressGzippedContent = decompressGzippedContent; -/** - * Builds a RegExp to test urls against for deciding - * wether to bypass proxy from an entry of the - * environment variable setting NO_PROXY - * - * @param {string} bypass - * @return {RegExp} - */ -function buildProxyBypassRegexFromEnv(bypass) { - // check if expression starts with asterisk and replace it with .* - if (bypass && bypass.startsWith("*")) { - bypass = bypass.replace("*", ".*"); - } - // replace all . symbols in string by \. because point is a special character - const safeRegex = (bypass || "").replace(Constants_1.searchRegExpToReplaceSpecialChars, '\\$1'); - return new RegExp(safeRegex, 'i'); -} -exports.buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv; -/** - * Obtain Response's Content Charset. - * Through inspecting `content-type` response header. - * It Returns 'utf-8' if NO charset specified/matched. - * - * @param {IHttpClientResponse} response - * @return {string} - Content Encoding Charset; Default=utf-8 - */ -function obtainContentCharset(response) { - // Find the charset, if specified. - // Search for the `charset=CHARSET` string, not including `;,\r\n` - // Example: content-type: 'application/json;charset=utf-8' - // |__ matches would be ['charset=utf-8', 'utf-8', index: 18, input: 'application/json; charset=utf-8'] - // |_____ matches[1] would have the charset :tada: , in our example it's utf-8 - // However, if the matches Array was empty or no charset found, 'utf-8' would be returned by default. - const nodeSupportedEncodings = ['ascii', 'utf8', 'utf16le', 'ucs2', 'base64', 'binary', 'hex']; - const contentType = response.message.headers['content-type'] || ''; - const matches = contentType.match(/charset=([^;,\r\n]+)/i); - return (matches && matches[1] && nodeSupportedEncodings.indexOf(matches[1]) != -1) ? matches[1] : 'utf-8'; -} -exports.obtainContentCharset = obtainContentCharset; /***/ }), -/***/ 7954: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2172: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", ({ value: true })); -class BasicCredentialHandler { - constructor(username, password, allowCrossOriginAuthentication) { - this.username = username; - this.password = password; - this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!this.origin) { - this.origin = options.host; - } - // If this is a redirection, don't set the Authorization header - if (this.origin === options.host || this.allowCrossOriginAuthentication) { - options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; - } - options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; - } -} -exports.BasicCredentialHandler = BasicCredentialHandler; + +var GetIntrinsic = __nccwpck_require__(4538); +var callBound = __nccwpck_require__(1785); +var inspect = __nccwpck_require__(504); + +var $TypeError = __nccwpck_require__(6361); +var $Map = GetIntrinsic('%Map%', true); + +/** @type {(thisArg: Map, key: K) => V} */ +var $mapGet = callBound('Map.prototype.get', true); +/** @type {(thisArg: Map, key: K, value: V) => void} */ +var $mapSet = callBound('Map.prototype.set', true); +/** @type {(thisArg: Map, key: K) => boolean} */ +var $mapHas = callBound('Map.prototype.has', true); +/** @type {(thisArg: Map, key: K) => boolean} */ +var $mapDelete = callBound('Map.prototype.delete', true); +/** @type {(thisArg: Map) => number} */ +var $mapSize = callBound('Map.prototype.size', true); + +/** @type {import('.')} */ +module.exports = !!$Map && /** @type {Exclude} */ function getSideChannelMap() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {Map | undefined} */ var $m; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($m) { + var result = $mapDelete($m, key); + if ($mapSize($m) === 0) { + $m = void undefined; + } + return result; + } + return false; + }, + get: function (key) { // eslint-disable-line consistent-return + if ($m) { + return $mapGet($m, key); + } + }, + has: function (key) { + if ($m) { + return $mapHas($m, key); + } + return false; + }, + set: function (key, value) { + if (!$m) { + // @ts-expect-error TS can't handle narrowing a variable inside a closure + $m = new $Map(); + } + $mapSet($m, key, value); + } + }; + + // @ts-expect-error TODO: figure out why TS is erroring here + return channel; +}; /***/ }), -/***/ 7431: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1012: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", ({ value: true })); -class BearerCredentialHandler { - constructor(token, allowCrossOriginAuthentication) { - this.token = token; - this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!this.origin) { - this.origin = options.host; - } - // If this is a redirection, don't set the Authorization header - if (this.origin === options.host || this.allowCrossOriginAuthentication) { - options.headers['Authorization'] = `Bearer ${this.token}`; - } - options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; - } -} -exports.BearerCredentialHandler = BearerCredentialHandler; + +var GetIntrinsic = __nccwpck_require__(4538); +var callBound = __nccwpck_require__(1785); +var inspect = __nccwpck_require__(504); +var getSideChannelMap = __nccwpck_require__(2172); + +var $TypeError = __nccwpck_require__(6361); +var $WeakMap = GetIntrinsic('%WeakMap%', true); + +/** @type {(thisArg: WeakMap, key: K) => V} */ +var $weakMapGet = callBound('WeakMap.prototype.get', true); +/** @type {(thisArg: WeakMap, key: K, value: V) => void} */ +var $weakMapSet = callBound('WeakMap.prototype.set', true); +/** @type {(thisArg: WeakMap, key: K) => boolean} */ +var $weakMapHas = callBound('WeakMap.prototype.has', true); +/** @type {(thisArg: WeakMap, key: K) => boolean} */ +var $weakMapDelete = callBound('WeakMap.prototype.delete', true); + +/** @type {import('.')} */ +module.exports = $WeakMap + ? /** @type {Exclude} */ function getSideChannelWeakMap() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {WeakMap | undefined} */ var $wm; + /** @type {Channel | undefined} */ var $m; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapDelete($wm, key); + } + } else if (getSideChannelMap) { + if ($m) { + return $m['delete'](key); + } + } + return false; + }, + get: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapGet($wm, key); + } + } + return $m && $m.get(key); + }, + has: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapHas($wm, key); + } + } + return !!$m && $m.has(key); + }, + set: function (key, value) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if (!$wm) { + $wm = new $WeakMap(); + } + $weakMapSet($wm, key, value); + } else if (getSideChannelMap) { + if (!$m) { + $m = getSideChannelMap(); + } + // eslint-disable-next-line no-extra-parens + /** @type {NonNullable} */ ($m).set(key, value); + } + } + }; + + // @ts-expect-error TODO: figure out why this is erroring + return channel; + } + : getSideChannelMap; /***/ }), -/***/ 4157: +/***/ 4334: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var $TypeError = __nccwpck_require__(6361); +var inspect = __nccwpck_require__(504); +var getSideChannelList = __nccwpck_require__(8206); +var getSideChannelMap = __nccwpck_require__(2172); +var getSideChannelWeakMap = __nccwpck_require__(1012); + +var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; + +/** @type {import('.')} */ +module.exports = function getSideChannel() { + /** @typedef {ReturnType} Channel */ + + /** @type {Channel | undefined} */ var $channelData; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + return !!$channelData && $channelData['delete'](key); + }, + get: function (key) { + return $channelData && $channelData.get(key); + }, + has: function (key) { + return !!$channelData && $channelData.has(key); + }, + set: function (key, value) { + if (!$channelData) { + $channelData = makeChannel(); + } + + $channelData.set(key, value); + } + }; + // @ts-expect-error TODO: figure out why this is erroring + return channel; +}; + + +/***/ }), + +/***/ 4294: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(4219); + + +/***/ }), + +/***/ 4219: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const http = __nccwpck_require__(3685); -const https = __nccwpck_require__(5687); -const _ = __nccwpck_require__(5067); -const ntlm = __nccwpck_require__(2673); -class NtlmCredentialHandler { - constructor(username, password, workstation, domain) { - this._ntlmOptions = {}; - this._ntlmOptions.username = username; - this._ntlmOptions.password = password; - this._ntlmOptions.domain = domain || ''; - this._ntlmOptions.workstation = workstation || ''; - } - prepareRequest(options) { - // No headers or options need to be set. We keep the credentials on the handler itself. - // If a (proxy) agent is set, remove it as we don't support proxy for NTLM at this time - if (options.agent) { - delete options.agent; - } - } - canHandleAuthentication(response) { - if (response && response.message && response.message.statusCode === 401) { - // Ensure that we're talking NTLM here - // Once we have the www-authenticate header, split it so we can ensure we can talk NTLM - const wwwAuthenticate = response.message.headers['www-authenticate']; - return wwwAuthenticate && (wwwAuthenticate.split(', ').indexOf("NTLM") >= 0); - } - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return new Promise((resolve, reject) => { - const callbackForResult = function (err, res) { - if (err) { - reject(err); - } - // We have to readbody on the response before continuing otherwise there is a hang. - res.readBody().then(() => { - resolve(res); - }); - }; - this.handleAuthenticationPrivate(httpClient, requestInfo, objs, callbackForResult); - }); - } - handleAuthenticationPrivate(httpClient, requestInfo, objs, finalCallback) { - // Set up the headers for NTLM authentication - requestInfo.options = _.extend(requestInfo.options, { - username: this._ntlmOptions.username, - password: this._ntlmOptions.password, - domain: this._ntlmOptions.domain, - workstation: this._ntlmOptions.workstation - }); - requestInfo.options.agent = httpClient.isSsl ? - new https.Agent({ keepAlive: true }) : - new http.Agent({ keepAlive: true }); - let self = this; - // The following pattern of sending the type1 message following immediately (in a setImmediate) is - // critical for the NTLM exchange to happen. If we removed setImmediate (or call in a different manner) - // the NTLM exchange will always fail with a 401. - this.sendType1Message(httpClient, requestInfo, objs, function (err, res) { - if (err) { - return finalCallback(err, null, null); - } - /// We have to readbody on the response before continuing otherwise there is a hang. - res.readBody().then(() => { - // It is critical that we have setImmediate here due to how connection requests are queued. - // If setImmediate is removed then the NTLM handshake will not work. - // setImmediate allows us to queue a second request on the same connection. If this second - // request is not queued on the connection when the first request finishes then node closes - // the connection. NTLM requires both requests to be on the same connection so we need this. - setImmediate(function () { - self.sendType3Message(httpClient, requestInfo, objs, res, finalCallback); - }); - }); - }); - } - // The following method is an adaptation of code found at https://github.com/SamDecrock/node-http-ntlm/blob/master/httpntlm.js - sendType1Message(httpClient, requestInfo, objs, finalCallback) { - const type1HexBuffer = ntlm.encodeType1(this._ntlmOptions.workstation, this._ntlmOptions.domain); - const type1msg = `NTLM ${type1HexBuffer.toString('base64')}`; - const type1options = { - headers: { - 'Connection': 'keep-alive', - 'Authorization': type1msg - }, - timeout: requestInfo.options.timeout || 0, - agent: requestInfo.httpModule, - }; - const type1info = {}; - type1info.httpModule = requestInfo.httpModule; - type1info.parsedUrl = requestInfo.parsedUrl; - type1info.options = _.extend(type1options, _.omit(requestInfo.options, 'headers')); - return httpClient.requestRawWithCallback(type1info, objs, finalCallback); - } - // The following method is an adaptation of code found at https://github.com/SamDecrock/node-http-ntlm/blob/master/httpntlm.js - sendType3Message(httpClient, requestInfo, objs, res, callback) { - if (!res.message.headers && !res.message.headers['www-authenticate']) { - throw new Error('www-authenticate not found on response of second request'); - } - /** - * Server will respond with challenge/nonce - * assigned to response's "WWW-AUTHENTICATE" header - * and should adhere to RegExp /^NTLM\s+(.+?)(,|\s+|$)/ - */ - const serverNonceRegex = /^NTLM\s+(.+?)(,|\s+|$)/; - const serverNonce = Buffer.from((res.message.headers['www-authenticate'].match(serverNonceRegex) || [])[1], 'base64'); - let type2msg; - /** - * Wrap decoding the Server's challenge/nonce in - * try-catch block to throw more comprehensive - * Error with clear message to consumer - */ - try { - type2msg = ntlm.decodeType2(serverNonce); - } - catch (error) { - throw new Error(`Decoding Server's Challenge to Obtain Type2Message failed with error: ${error.message}`); - } - const type3msg = ntlm.encodeType3(this._ntlmOptions.username, this._ntlmOptions.workstation, this._ntlmOptions.domain, type2msg, this._ntlmOptions.password).toString('base64'); - const type3options = { - headers: { - 'Authorization': `NTLM ${type3msg}`, - 'Connection': 'Close' - }, - agent: requestInfo.httpModule, - }; - const type3info = {}; - type3info.httpModule = requestInfo.httpModule; - type3info.parsedUrl = requestInfo.parsedUrl; - type3options.headers = _.extend(type3options.headers, requestInfo.options.headers); - type3info.options = _.extend(type3options, _.omit(requestInfo.options, 'headers')); - return httpClient.requestRawWithCallback(type3info, objs, callback); - } + +var net = __nccwpck_require__(1808); +var tls = __nccwpck_require__(4404); +var http = __nccwpck_require__(3685); +var https = __nccwpck_require__(5687); +var events = __nccwpck_require__(2361); +var assert = __nccwpck_require__(9491); +var util = __nccwpck_require__(3837); + + +exports.httpOverHttp = httpOverHttp; +exports.httpsOverHttp = httpsOverHttp; +exports.httpOverHttps = httpOverHttps; +exports.httpsOverHttps = httpsOverHttps; + + +function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + return agent; } -exports.NtlmCredentialHandler = NtlmCredentialHandler; +function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; +} -/***/ }), +function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + return agent; +} -/***/ 7799: -/***/ ((__unused_webpack_module, exports) => { +function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; +} -"use strict"; -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -Object.defineProperty(exports, "__esModule", ({ value: true })); -class PersonalAccessTokenCredentialHandler { - constructor(token, allowCrossOriginAuthentication) { - this.token = token; - this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; +function TunnelingAgent(options) { + var self = this; + self.options = options || {}; + self.proxyOptions = self.options.proxy || {}; + self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; + self.requests = []; + self.sockets = []; + + self.on('free', function onFree(socket, host, port, localAddress) { + var options = toOptions(host, port, localAddress); + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i]; + if (pending.host === options.host && pending.port === options.port) { + // Detect the request to connect same origin server, + // reuse the connection. + self.requests.splice(i, 1); + pending.request.onSocket(socket); + return; + } } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!this.origin) { - this.origin = options.host; - } - // If this is a redirection, don't set the Authorization header - if (this.origin === options.host || this.allowCrossOriginAuthentication) { - options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; - } - options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; + socket.destroy(); + self.removeSocket(socket); + }); +} +util.inherits(TunnelingAgent, events.EventEmitter); + +TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { + var self = this; + var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); + + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push(options); + return; + } + + // If we are under maxSockets create a new one. + self.createSocket(options, function(socket) { + socket.on('free', onFree); + socket.on('close', onCloseOrRemove); + socket.on('agentRemove', onCloseOrRemove); + req.onSocket(socket); + + function onFree() { + self.emit('free', socket, options); } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; + + function onCloseOrRemove(err) { + self.removeSocket(socket); + socket.removeListener('free', onFree); + socket.removeListener('close', onCloseOrRemove); + socket.removeListener('agentRemove', onCloseOrRemove); } - handleAuthentication(httpClient, requestInfo, objs) { - return null; + }); +}; + +TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this; + var placeholder = {}; + self.sockets.push(placeholder); + + var connectOptions = mergeOptions({}, self.proxyOptions, { + method: 'CONNECT', + path: options.host + ':' + options.port, + agent: false, + headers: { + host: options.host + ':' + options.port } -} -exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + }); + if (options.localAddress) { + connectOptions.localAddress = options.localAddress; + } + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {}; + connectOptions.headers['Proxy-Authorization'] = 'Basic ' + + new Buffer(connectOptions.proxyAuth).toString('base64'); + } + debug('making CONNECT request'); + var connectReq = self.request(connectOptions); + connectReq.useChunkedEncodingByDefault = false; // for v0.6 + connectReq.once('response', onResponse); // for v0.6 + connectReq.once('upgrade', onUpgrade); // for v0.6 + connectReq.once('connect', onConnect); // for v0.7 or later + connectReq.once('error', onError); + connectReq.end(); -/***/ }), + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true; + } -/***/ 7864: -/***/ ((module) => { + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function() { + onConnect(res, socket, head); + }); + } -"use strict"; + function onConnect(res, socket, head) { + connectReq.removeAllListeners(); + socket.removeAllListeners(); + if (res.statusCode !== 200) { + debug('tunneling socket could not be established, statusCode=%d', + res.statusCode); + socket.destroy(); + var error = new Error('tunneling socket could not be established, ' + + 'statusCode=' + res.statusCode); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + return; + } + if (head.length > 0) { + debug('got illegal response body from proxy'); + socket.destroy(); + var error = new Error('got illegal response body from proxy'); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + return; + } + debug('tunneling connection has established'); + self.sockets[self.sockets.indexOf(placeholder)] = socket; + return cb(socket); + } -var replace = String.prototype.replace; -var percentTwenties = /%20/g; + function onError(cause) { + connectReq.removeAllListeners(); -var Format = { - RFC1738: 'RFC1738', - RFC3986: 'RFC3986' + debug('tunneling socket could not be established, cause=%s\n', + cause.message, cause.stack); + var error = new Error('tunneling socket could not be established, ' + + 'cause=' + cause.message); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + } }; -module.exports = { - 'default': Format.RFC3986, - formatters: { - RFC1738: function (value) { - return replace.call(value, percentTwenties, '+'); - }, - RFC3986: function (value) { - return String(value); - } - }, - RFC1738: Format.RFC1738, - RFC3986: Format.RFC3986 +TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket) + if (pos === -1) { + return; + } + this.sockets.splice(pos, 1); + + var pending = this.requests.shift(); + if (pending) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createSocket(pending, function(socket) { + pending.request.onSocket(socket); + }); + } }; +function createSecureSocket(options, cb) { + var self = this; + TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { + var hostHeader = options.request.getHeader('host'); + var tlsOptions = mergeOptions({}, self.options, { + socket: socket, + servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host + }); -/***/ }), + // 0 is dummy port for v0.6 + var secureSocket = tls.connect(0, tlsOptions); + self.sockets[self.sockets.indexOf(socket)] = secureSocket; + cb(secureSocket); + }); +} -/***/ 9615: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +function toOptions(host, port, localAddress) { + if (typeof host === 'string') { // since v0.10 + return { + host: host, + port: port, + localAddress: localAddress + }; + } + return host; // for v0.11 or later +} +function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i]; + if (typeof overrides === 'object') { + var keys = Object.keys(overrides); + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j]; + if (overrides[k] !== undefined) { + target[k] = overrides[k]; + } + } + } + } + return target; +} -var stringify = __nccwpck_require__(3599); -var parse = __nccwpck_require__(748); -var formats = __nccwpck_require__(7864); -module.exports = { - formats: formats, - parse: parse, - stringify: stringify -}; +var debug; +if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function() { + var args = Array.prototype.slice.call(arguments); + if (typeof args[0] === 'string') { + args[0] = 'TUNNEL: ' + args[0]; + } else { + args.unshift('TUNNEL:'); + } + console.error.apply(console, args); + } +} else { + debug = function() {}; +} +exports.debug = debug; // for test /***/ }), -/***/ 748: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 4442: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PersonalAccessTokenCredentialHandler = exports.NtlmCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; +var basiccreds_1 = __nccwpck_require__(7954); +Object.defineProperty(exports, "BasicCredentialHandler", ({ enumerable: true, get: function () { return basiccreds_1.BasicCredentialHandler; } })); +var bearertoken_1 = __nccwpck_require__(7431); +Object.defineProperty(exports, "BearerCredentialHandler", ({ enumerable: true, get: function () { return bearertoken_1.BearerCredentialHandler; } })); +var ntlm_1 = __nccwpck_require__(4157); +Object.defineProperty(exports, "NtlmCredentialHandler", ({ enumerable: true, get: function () { return ntlm_1.NtlmCredentialHandler; } })); +var personalaccesstoken_1 = __nccwpck_require__(7799); +Object.defineProperty(exports, "PersonalAccessTokenCredentialHandler", ({ enumerable: true, get: function () { return personalaccesstoken_1.PersonalAccessTokenCredentialHandler; } })); -var utils = __nccwpck_require__(7154); -var has = Object.prototype.hasOwnProperty; -var isArray = Array.isArray; +/***/ }), -var defaults = { - allowDots: false, - allowPrototypes: false, - allowSparse: false, - arrayLimit: 20, - charset: 'utf-8', - charsetSentinel: false, - comma: false, - decoder: utils.decode, - delimiter: '&', - depth: 5, - ignoreQueryPrefix: false, - interpretNumericEntities: false, - parameterLimit: 1000, - parseArrays: true, - plainObjects: false, - strictNullHandling: false -}; +/***/ 5538: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -var interpretNumericEntities = function (str) { - return str.replace(/&#(\d+);/g, function ($0, numberStr) { - return String.fromCharCode(parseInt(numberStr, 10)); +"use strict"; + +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - -var parseArrayValue = function (val, options) { - if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { - return val.split(','); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpClient = exports.HttpClientResponse = exports.HttpCodes = void 0; +exports.isHttps = isHttps; +const url = __nccwpck_require__(7310); +const http = __nccwpck_require__(3685); +const https = __nccwpck_require__(5687); +const util = __nccwpck_require__(9470); +let fs; +let tunnel; +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes || (exports.HttpCodes = HttpCodes = {})); +const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect]; +const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout]; +const NetworkRetryErrors = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH']; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + const encodingCharset = util.obtainContentCharset(this); + // Extract Encoding from header: 'content-encoding' + // Match `gzip`, `gzip, deflate` variations of GZIP encoding + const contentEncoding = this.message.headers['content-encoding'] || ''; + const isGzippedEncoded = new RegExp('(gzip$)|(gzip, *deflate)').test(contentEncoding); + this.message.on('data', function (data) { + const chunk = (typeof data === 'string') ? Buffer.from(data, encodingCharset) : data; + chunks.push(chunk); + }).on('end', function () { + return __awaiter(this, void 0, void 0, function* () { + const buffer = Buffer.concat(chunks); + if (isGzippedEncoded) { // Process GZipped Response Body HERE + const gunzippedBody = yield util.decompressGzippedContent(buffer, encodingCharset); + resolve(gunzippedBody); + } + else { + resolve(buffer.toString(encodingCharset)); + } + }); + }).on('error', function (err) { + reject(err); + }); + })); + } +} +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + let parsedUrl = url.parse(requestUrl); + return parsedUrl.protocol === 'https:'; +} +var EnvironmentVariables; +(function (EnvironmentVariables) { + EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY"; + EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY"; + EnvironmentVariables["NO_PROXY"] = "NO_PROXY"; +})(EnvironmentVariables || (EnvironmentVariables = {})); +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this._httpGlobalAgentOptions = { + keepAlive: false, + timeout: 30000 + }; + this.userAgent = userAgent; + this.handlers = handlers || []; + let no_proxy = process.env[EnvironmentVariables.NO_PROXY]; + if (no_proxy) { + this._httpProxyBypassHosts = []; + no_proxy.split(',').forEach(bypass => { + this._httpProxyBypassHosts.push(util.buildProxyBypassRegexFromEnv(bypass)); + }); + } + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + this._httpProxy = requestOptions.proxy; + if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) { + this._httpProxyBypassHosts = []; + requestOptions.proxy.proxyBypassHosts.forEach(bypass => { + this._httpProxyBypassHosts.push(new RegExp(bypass, 'i')); + }); + } + if (requestOptions.globalAgentOptions) { + this._httpGlobalAgentOptions = requestOptions.globalAgentOptions; + } + this._certConfig = requestOptions.cert; + if (this._certConfig) { + // If using cert, need fs + fs = __nccwpck_require__(7147); + // cache the cert content into memory, so we don't have to read it from disk every time + if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) { + this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8'); + } + if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) { + this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8'); + } + if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) { + this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8'); + } + } + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } + } + } + options(requestUrl, additionalHeaders) { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + } + get(requestUrl, additionalHeaders) { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + } + del(requestUrl, additionalHeaders) { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + } + post(requestUrl, data, additionalHeaders) { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + } + patch(requestUrl, data, additionalHeaders) { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + } + put(requestUrl, data, additionalHeaders) { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + } + head(requestUrl, additionalHeaders) { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return this.request(verb, requestUrl, stream, additionalHeaders); } - - return val; -}; - -// This is what browsers will submit when the ✓ character occurs in an -// application/x-www-form-urlencoded body and the encoding of the page containing -// the form is iso-8859-1, or when the submitted form has an accept-charset -// attribute of iso-8859-1. Presumably also with other charsets that do not contain -// the ✓ character, such as us-ascii. -var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') - -// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. -var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') - -var parseValues = function parseQueryStringValues(str, options) { - var obj = {}; - var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; - var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; - var parts = cleanStr.split(options.delimiter, limit); - var skipIndex = -1; // Keep track of where the utf8 sentinel was found - var i; - - var charset = options.charset; - if (options.charsetSentinel) { - for (i = 0; i < parts.length; ++i) { - if (parts[i].indexOf('utf8=') === 0) { - if (parts[i] === charsetSentinel) { - charset = 'utf-8'; - } else if (parts[i] === isoSentinel) { - charset = 'iso-8859-1'; + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error("Client has already been disposed."); + } + let parsedUrl = url.parse(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1; + let numTries = 0; + let response; + while (numTries < maxTries) { + try { + response = yield this.requestRaw(info, data); + } + catch (err) { + numTries++; + if (err && err.code && NetworkRetryErrors.indexOf(err.code) > -1 && numTries < maxTries) { + yield this._performExponentialBackoff(numTries); + continue; + } + throw err; + } + // Check if it's an authentication challenge + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (let i = 0; i < this.handlers.length; i++) { + if (this.handlers[i].canHandleAuthentication(response)) { + authenticationHandler = this.handlers[i]; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 + && this._allowRedirects + && redirectsRemaining > 0) { + const redirectUrl = response.message.headers["location"]; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + let parsedRedirectUrl = url.parse(redirectUrl); + if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { + throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + yield response.readBody(); + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); } - skipIndex = i; - i = parts.length; // The eslint settings do not allow break; } - } + return response; + }); } - - for (i = 0; i < parts.length; ++i) { - if (i === skipIndex) { - continue; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } - var part = parts[i]; - - var bracketEqualsPos = part.indexOf(']='); - var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; - - var key, val; - if (pos === -1) { - key = options.decoder(part, defaults.decoder, charset, 'key'); - val = options.strictNullHandling ? null : ''; - } else { - key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); - val = utils.maybeMap( - parseArrayValue(part.slice(pos + 1), options), - function (encodedVal) { - return options.decoder(encodedVal, defaults.decoder, charset, 'value'); + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return new Promise((resolve, reject) => { + let callbackForResult = function (err, res) { + if (err) { + reject(err); } - ); + resolve(res); + }; + this.requestRawWithCallback(info, data, callbackForResult); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + let socket; + if (typeof (data) === 'string') { + info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8'); } - - if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { - val = interpretNumericEntities(val); + let callbackCalled = false; + let handleResult = (err, res) => { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + }; + let req = info.httpModule.request(info.options, (msg) => { + let res = new HttpClientResponse(msg); + handleResult(null, res); + }); + req.on('socket', (sock) => { + socket = sock; + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.destroy(); + } + handleResult(new Error('Request timeout: ' + info.options.path), null); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err, null); + }); + if (data && typeof (data) === 'string') { + req.write(data, 'utf8'); } - - if (part.indexOf('[]=') > -1) { - val = isArray(val) ? [val] : val; + if (data && typeof (data) !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); } - - if (has.call(obj, key)) { - obj[key] = utils.combine(obj[key], val); - } else { - obj[key] = val; + else { + req.end(); } } - - return obj; -}; - -var parseObject = function (chain, val, options, valuesParsed) { - var leaf = valuesParsed ? val : parseArrayValue(val, options); - - for (var i = chain.length - 1; i >= 0; --i) { - var obj; - var root = chain[i]; - - if (root === '[]' && options.parseArrays) { - obj = [].concat(leaf); - } else { - obj = options.plainObjects ? Object.create(null) : {}; - var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; - var index = parseInt(cleanRoot, 10); - if (!options.parseArrays && cleanRoot === '') { - obj = { 0: leaf }; - } else if ( - !isNaN(index) - && root !== cleanRoot - && String(index) === cleanRoot - && index >= 0 - && (options.parseArrays && index <= options.arrayLimit) - ) { - obj = []; - obj[index] = leaf; - } else if (cleanRoot !== '__proto__') { - obj[cleanRoot] = leaf; - } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; + info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.timeout = (this.requestOptions && this.requestOptions.socketTimeout) || this._socketTimeout; + this._socketTimeout = info.options.timeout; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers["user-agent"] = this.userAgent; } - - leaf = obj; - } - - return leaf; -}; - -var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { - if (!givenKey) { - return; - } - - // Transform dot notation to bracket notation - var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; - - // The regex chunks - - var brackets = /(\[[^[\]]*])/; - var child = /(\[[^[\]]*])/g; - - // Get the parent - - var segment = options.depth > 0 && brackets.exec(key); - var parent = segment ? key.slice(0, segment.index) : key; - - // Stash the parent if it exists - - var keys = []; - if (parent) { - // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties - if (!options.plainObjects && has.call(Object.prototype, parent)) { - if (!options.allowPrototypes) { - return; - } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers && !this._isPresigned(url.format(requestUrl))) { + this.handlers.forEach((handler) => { + handler.prepareRequest(info.options); + }); } - - keys.push(parent); + return info; } - - // Loop through children appending to the array until we hit depth - - var i = 0; - while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { - i += 1; - if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { - if (!options.allowPrototypes) { - return; + _isPresigned(requestUrl) { + if (this.requestOptions && this.requestOptions.presignedUrlPatterns) { + const patterns = this.requestOptions.presignedUrlPatterns; + for (let i = 0; i < patterns.length; i++) { + if (requestUrl.match(patterns[i])) { + return true; + } } } - keys.push(segment[1]); - } - - // If there's a remainder, just add whatever is left - - if (segment) { - keys.push('[' + key.slice(segment.index) + ']'); - } - - return parseObject(keys, val, options, valuesParsed); -}; - -var normalizeParseOptions = function normalizeParseOptions(opts) { - if (!opts) { - return defaults; - } - - if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { - throw new TypeError('Decoder has to be a function.'); - } - - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; - - return { - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, - allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, - arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, - decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, - delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, - // eslint-disable-next-line no-implicit-coercion, no-extra-parens - depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, - ignoreQueryPrefix: opts.ignoreQueryPrefix === true, - interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, - parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, - parseArrays: opts.parseArrays !== false, - plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (str, opts) { - var options = normalizeParseOptions(opts); - - if (str === '' || str === null || typeof str === 'undefined') { - return options.plainObjects ? Object.create(null) : {}; - } - - var tempObj = typeof str === 'string' ? parseValues(str, options) : str; - var obj = options.plainObjects ? Object.create(null) : {}; - - // Iterate over the keys and setup the new object - - var keys = Object.keys(tempObj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); - obj = utils.merge(obj, newObj, options); - } - - if (options.allowSparse === true) { - return obj; + return false; } - - return utils.compact(obj); -}; - - -/***/ }), - -/***/ 3599: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var getSideChannel = __nccwpck_require__(4334); -var utils = __nccwpck_require__(7154); -var formats = __nccwpck_require__(7864); -var has = Object.prototype.hasOwnProperty; - -var arrayPrefixGenerators = { - brackets: function brackets(prefix) { - return prefix + '[]'; - }, - comma: 'comma', - indices: function indices(prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function repeat(prefix) { - return prefix; + _mergeHeaders(headers) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); + } + return lowercaseKeys(headers || {}); } -}; - -var isArray = Array.isArray; -var split = String.prototype.split; -var push = Array.prototype.push; -var pushToArray = function (arr, valueOrArray) { - push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); -}; - -var toISO = Date.prototype.toISOString; - -var defaultFormat = formats['default']; -var defaults = { - addQueryPrefix: false, - allowDots: false, - charset: 'utf-8', - charsetSentinel: false, - delimiter: '&', - encode: true, - encoder: utils.encode, - encodeValuesOnly: false, - format: defaultFormat, - formatter: formats.formatters[defaultFormat], - // deprecated - indices: false, - serializeDate: function serializeDate(date) { - return toISO.call(date); - }, - skipNulls: false, - strictNullHandling: false -}; - -var isNonNullishPrimitive = function isNonNullishPrimitive(v) { - return typeof v === 'string' - || typeof v === 'number' - || typeof v === 'boolean' - || typeof v === 'symbol' - || typeof v === 'bigint'; -}; - -var sentinel = {}; - -var stringify = function stringify( - object, - prefix, - generateArrayPrefix, - commaRoundTrip, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - sideChannel -) { - var obj = object; - - var tmpSc = sideChannel; - var step = 0; - var findFlag = false; - while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { - // Where object last appeared in the ref tree - var pos = tmpSc.get(object); - step += 1; - if (typeof pos !== 'undefined') { - if (pos === step) { - throw new RangeError('Cyclic object value'); - } else { - findFlag = true; // Break while + _getAgent(parsedUrl) { + let agent; + let proxy = this._getProxy(parsedUrl); + let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isMatchInBypassProxyList(parsedUrl); + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (this._keepAlive && !useProxy) { + agent = this._agent; + } + // if agent is already assigned use that agent. + if (!!agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (!!this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + if (useProxy) { + // If using proxy, need tunnel + if (!tunnel) { + tunnel = __nccwpck_require__(4294); + } + const agentOptions = { + maxSockets: maxSockets, + keepAlive: this._keepAlive, + proxy: { + proxyAuth: proxy.proxyAuth, + host: proxy.proxyUrl.hostname, + port: proxy.proxyUrl.port + }, + }; + let tunnelAgent; + const overHttps = proxy.proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; } - if (typeof tmpSc.get(sentinel) === 'undefined') { - step = 0; + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { + const globalAgentOptions = { + keepAlive: this._httpGlobalAgentOptions.keepAlive, + timeout: this._httpGlobalAgentOptions.timeout + }; + agent = usingSsl ? new https.Agent(globalAgentOptions) : new http.Agent(globalAgentOptions); + } + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); } + if (usingSsl && this._certConfig) { + agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase }); + } + return agent; } - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = utils.maybeMap(obj, function (value) { - if (value instanceof Date) { - return serializeDate(value); + _getProxy(parsedUrl) { + let usingSsl = parsedUrl.protocol === 'https:'; + let proxyConfig = this._httpProxy; + // fallback to http_proxy and https_proxy env + let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY]; + let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY]; + if (!proxyConfig) { + if (https_proxy && usingSsl) { + proxyConfig = { + proxyUrl: https_proxy + }; + } + else if (http_proxy) { + proxyConfig = { + proxyUrl: http_proxy + }; } - return value; - }); - } - - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; } - - obj = ''; - } - - if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { - if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); - if (generateArrayPrefix === 'comma' && encodeValuesOnly) { - var valuesArray = split.call(String(obj), ','); - var valuesJoined = ''; - for (var i = 0; i < valuesArray.length; ++i) { - valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format)); - } - return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined]; + let proxyUrl; + let proxyAuth; + if (proxyConfig) { + if (proxyConfig.proxyUrl.length > 0) { + proxyUrl = url.parse(proxyConfig.proxyUrl); + } + if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) { + proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword; } - return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; } - return [formatter(prefix) + '=' + formatter(String(obj))]; + return { proxyUrl: proxyUrl, proxyAuth: proxyAuth }; } - - var values = []; - - if (typeof obj === 'undefined') { - return values; + _isMatchInBypassProxyList(parsedUrl) { + if (!this._httpProxyBypassHosts) { + return false; + } + let bypass = false; + this._httpProxyBypassHosts.forEach(bypassHost => { + if (bypassHost.test(parsedUrl.href)) { + bypass = true; + } + }); + return bypass; } - - var objKeys; - if (generateArrayPrefix === 'comma' && isArray(obj)) { - // we need to join elements in - objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; - } else if (isArray(filter)) { - objKeys = filter; - } else { - var keys = Object.keys(obj); - objKeys = sort ? keys.sort(sort) : keys; + _performExponentialBackoff(retryNumber) { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); } +} +exports.HttpClient = HttpClient; - var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix; - - for (var j = 0; j < objKeys.length; ++j) { - var key = objKeys[j]; - var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key]; - if (skipNulls && value === null) { - continue; - } +/***/ }), - var keyPrefix = isArray(obj) - ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix - : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']'); +/***/ 7405: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - sideChannel.set(object, step); - var valueSideChannel = getSideChannel(); - valueSideChannel.set(sentinel, sideChannel); - pushToArray(values, stringify( - value, - keyPrefix, - generateArrayPrefix, - commaRoundTrip, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel - )); - } +"use strict"; - return values; +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - -var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { - if (!opts) { - return defaults; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RestClient = void 0; +const httpm = __nccwpck_require__(5538); +const util = __nccwpck_require__(9470); +class RestClient { + /** + * Creates an instance of the RestClient + * @constructor + * @param {string} userAgent - userAgent for requests + * @param {string} baseUrl - (Optional) If not specified, use full urls per request. If supplied and a function passes a relative url, it will be appended to this + * @param {ifm.IRequestHandler[]} handlers - handlers are typically auth handlers (basic, bearer, ntlm supplied) + * @param {ifm.IRequestOptions} requestOptions - options for each http requests (http proxy setting, socket timeout) + */ + constructor(userAgent, baseUrl, handlers, requestOptions) { + this.client = new httpm.HttpClient(userAgent, handlers, requestOptions); + if (baseUrl) { + this._baseUrl = baseUrl; + } } - - if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); + /** + * Gets a resource from an endpoint + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} requestUrl - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + options(requestUrl, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(requestUrl, this._baseUrl); + let res = yield this.client.options(url, this._headersFromOptions(options)); + return this.processResponse(res, options); + }); } - - var charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + /** + * Gets a resource from an endpoint + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified url or relative path + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + get(resource, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(resource, this._baseUrl, (options || {}).queryParameters); + let res = yield this.client.get(url, this._headersFromOptions(options)); + return this.processResponse(res, options); + }); } - - var format = formats['default']; - if (typeof opts.format !== 'undefined') { - if (!has.call(formats.formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); + /** + * Deletes a resource from an endpoint + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + del(resource, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(resource, this._baseUrl, (options || {}).queryParameters); + let res = yield this.client.del(url, this._headersFromOptions(options)); + return this.processResponse(res, options); + }); + } + /** + * Creates resource(s) from an endpoint + * T type of object returned. + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + create(resource, resources, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(resource, this._baseUrl); + let headers = this._headersFromOptions(options, true); + let data = JSON.stringify(resources, null, 2); + let res = yield this.client.post(url, data, headers); + return this.processResponse(res, options); + }); + } + /** + * Updates resource(s) from an endpoint + * T type of object returned. + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + update(resource, resources, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(resource, this._baseUrl); + let headers = this._headersFromOptions(options, true); + let data = JSON.stringify(resources, null, 2); + let res = yield this.client.patch(url, data, headers); + return this.processResponse(res, options); + }); + } + /** + * Replaces resource(s) from an endpoint + * T type of object returned. + * Be aware that not found returns a null. Other error conditions reject the promise + * @param {string} resource - fully qualified or relative url + * @param {IRequestOptions} requestOptions - (optional) requestOptions object + */ + replace(resource, resources, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(resource, this._baseUrl); + let headers = this._headersFromOptions(options, true); + let data = JSON.stringify(resources, null, 2); + let res = yield this.client.put(url, data, headers); + return this.processResponse(res, options); + }); + } + uploadStream(verb, requestUrl, stream, options) { + return __awaiter(this, void 0, void 0, function* () { + let url = util.getUrl(requestUrl, this._baseUrl); + let headers = this._headersFromOptions(options, true); + let res = yield this.client.sendStream(verb, url, stream, headers); + return this.processResponse(res, options); + }); + } + _headersFromOptions(options, contentType) { + options = options || {}; + let headers = options.additionalHeaders || {}; + headers["Accept"] = options.acceptHeader || "application/json"; + if (contentType) { + let found = false; + for (let header in headers) { + if (header.toLowerCase() == "content-type") { + found = true; + } + } + if (!found) { + headers["Content-Type"] = 'application/json; charset=utf-8'; + } } - format = opts.format; + return headers; } - var formatter = formats.formatters[format]; - - var filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; + static dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + let a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; } + processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode; + const response = { + statusCode: statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode == httpm.HttpCodes.NotFound) { + resolve(response); + } + let obj; + let contents; + // get the result from the body + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, RestClient.dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + if (options && options.responseProcessor) { + response.result = options.responseProcessor(obj); + } + else { + response.result = obj; + } + } + response.headers = res.message.headers; + } + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = "Failed request: (" + statusCode + ")"; + } + let err = new Error(msg); + // attach statusCode and body obj (if available) to the error object + err['statusCode'] = statusCode; + if (response.result) { + err['result'] = response.result; + } + if (response.headers) { + err['responseHeaders'] = response.headers; + } + reject(err); + } + else { + resolve(response); + } + })); + }); + } +} +exports.RestClient = RestClient; - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - format: format, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (object, opts) { - var obj = object; - var options = normalizeStringifyOptions(opts); - - var objKeys; - var filter; - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (isArray(options.filter)) { - filter = options.filter; - objKeys = filter; - } +/***/ }), - var keys = []; +/***/ 9470: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - if (typeof obj !== 'object' || obj === null) { - return ''; - } +"use strict"; - var arrayFormat; - if (opts && opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if (opts && 'indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = 'indices'; +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getUrl = getUrl; +exports.decompressGzippedContent = decompressGzippedContent; +exports.buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv; +exports.obtainContentCharset = obtainContentCharset; +const qs = __nccwpck_require__(2760); +const url = __nccwpck_require__(7310); +const path = __nccwpck_require__(1017); +const zlib = __nccwpck_require__(9796); +/** + * creates an url from a request url and optional base url (http://server:8080) + * @param {string} resource - a fully qualified url or relative path + * @param {string} baseUrl - an optional baseUrl (http://server:8080) + * @param {IRequestOptions} options - an optional options object, could include QueryParameters e.g. + * @return {string} - resultant url + */ +function getUrl(resource, baseUrl, queryParams) { + const pathApi = path.posix || path; + let requestUrl = ''; + if (!baseUrl) { + requestUrl = resource; } - - var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; - if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { - throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + else if (!resource) { + requestUrl = baseUrl; } - var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip; - - if (!objKeys) { - objKeys = Object.keys(obj); + else { + const base = url.parse(baseUrl); + const resultantUrl = url.parse(resource); + // resource (specific per request) elements take priority + resultantUrl.protocol = resultantUrl.protocol || base.protocol; + resultantUrl.auth = resultantUrl.auth || base.auth; + resultantUrl.host = resultantUrl.host || base.host; + resultantUrl.pathname = pathApi.resolve(base.pathname, resultantUrl.pathname); + if (!resultantUrl.pathname.endsWith('/') && resource.endsWith('/')) { + resultantUrl.pathname += '/'; + } + requestUrl = url.format(resultantUrl); } - - if (options.sort) { - objKeys.sort(options.sort); + return queryParams ? + getUrlWithParsedQueryParams(requestUrl, queryParams) : + requestUrl; +} +/** + * + * @param {string} requestUrl + * @param {IRequestQueryParams} queryParams + * @return {string} - Request's URL with Query Parameters appended/parsed. + */ +function getUrlWithParsedQueryParams(requestUrl, queryParams) { + const url = requestUrl.replace(/\?$/g, ''); // Clean any extra end-of-string "?" character + const parsedQueryParams = qs.stringify(queryParams.params, buildParamsStringifyOptions(queryParams)); + return `${url}${parsedQueryParams}`; +} +/** + * Build options for QueryParams Stringifying. + * + * @param {IRequestQueryParams} queryParams + * @return {object} + */ +function buildParamsStringifyOptions(queryParams) { + let options = { + addQueryPrefix: true, + delimiter: (queryParams.options || {}).separator || '&', + allowDots: (queryParams.options || {}).shouldAllowDots || false, + arrayFormat: (queryParams.options || {}).arrayFormat || 'repeat', + encodeValuesOnly: (queryParams.options || {}).shouldOnlyEncodeValues || true + }; + return options; +} +/** + * Decompress/Decode gzip encoded JSON + * Using Node.js built-in zlib module + * + * @param {Buffer} buffer + * @param {string} charset? - optional; defaults to 'utf-8' + * @return {Promise} + */ +function decompressGzippedContent(buffer, charset) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + zlib.gunzip(buffer, function (error, buffer) { + if (error) { + reject(error); + } + else { + resolve(buffer.toString(charset || 'utf-8')); + } + }); + })); + }); +} +/** + * Builds a RegExp to test urls against for deciding + * wether to bypass proxy from an entry of the + * environment variable setting NO_PROXY + * + * @param {string} bypass + * @return {RegExp} + */ +function buildProxyBypassRegexFromEnv(bypass) { + try { + // We need to keep this around for back-compat purposes + return new RegExp(bypass, 'i'); } - - var sideChannel = getSideChannel(); - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - - if (options.skipNulls && obj[key] === null) { - continue; + catch (err) { + if (err instanceof SyntaxError && (bypass || "").startsWith("*")) { + let wildcardEscaped = bypass.replace('*', '(.*)'); + return new RegExp(wildcardEscaped, 'i'); } - pushToArray(keys, stringify( - obj[key], - key, - generateArrayPrefix, - commaRoundTrip, - options.strictNullHandling, - options.skipNulls, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel - )); + throw err; } - - var joined = keys.join(options.delimiter); - var prefix = options.addQueryPrefix === true ? '?' : ''; - - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } +} +/** + * Obtain Response's Content Charset. + * Through inspecting `content-type` response header. + * It Returns 'utf-8' if NO charset specified/matched. + * + * @param {IHttpClientResponse} response + * @return {string} - Content Encoding Charset; Default=utf-8 + */ +function obtainContentCharset(response) { + // Find the charset, if specified. + // Search for the `charset=CHARSET` string, not including `;,\r\n` + // Example: content-type: 'application/json;charset=utf-8' + // |__ matches would be ['charset=utf-8', 'utf-8', index: 18, input: 'application/json; charset=utf-8'] + // |_____ matches[1] would have the charset :tada: , in our example it's utf-8 + // However, if the matches Array was empty or no charset found, 'utf-8' would be returned by default. + const nodeSupportedEncodings = ['ascii', 'utf8', 'utf16le', 'ucs2', 'base64', 'binary', 'hex']; + const contentType = response.message.headers['content-type'] || ''; + const matches = contentType.match(/charset=([^;,\r\n]+)/i); + if (matches && matches[1] && nodeSupportedEncodings.indexOf(matches[1]) != -1) { + return matches[1]; } - - return joined.length > 0 ? prefix + joined : ''; -}; + return 'utf-8'; +} /***/ }), -/***/ 7154: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 7954: +/***/ ((__unused_webpack_module, exports) => { "use strict"; - -var formats = __nccwpck_require__(7864); - -var has = Object.prototype.hasOwnProperty; -var isArray = Array.isArray; - -var hexTable = (function () { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BasicCredentialHandler = void 0; +class BasicCredentialHandler { + constructor(username, password, allowCrossOriginAuthentication) { + this.username = username; + this.password = password; + this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!this.origin) { + this.origin = options.host; + } + // If this is a redirection, don't set the Authorization header + if (this.origin === options.host || this.allowCrossOriginAuthentication) { + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; + } + options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; } +} +exports.BasicCredentialHandler = BasicCredentialHandler; - return array; -}()); -var compactQueue = function compactQueue(queue) { - while (queue.length > 1) { - var item = queue.pop(); - var obj = item.obj[item.prop]; +/***/ }), - if (isArray(obj)) { - var compacted = []; +/***/ 7431: +/***/ ((__unused_webpack_module, exports) => { - for (var j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } +"use strict"; - item.obj[item.prop] = compacted; - } +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BearerCredentialHandler = void 0; +class BearerCredentialHandler { + constructor(token, allowCrossOriginAuthentication) { + this.token = token; + this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; } -}; - -var arrayToObject = function arrayToObject(source, options) { - var obj = options && options.plainObjects ? Object.create(null) : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!this.origin) { + this.origin = options.host; } - } - - return obj; -}; - -var merge = function merge(target, source, options) { - /* eslint no-param-reassign: 0 */ - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (isArray(target)) { - target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; + // If this is a redirection, don't set the Authorization header + if (this.origin === options.host || this.allowCrossOriginAuthentication) { + options.headers['Authorization'] = `Bearer ${this.token}`; } - - return target; + options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; } - - if (!target || typeof target !== 'object') { - return [target].concat(source); + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; } - - var mergeTarget = target; - if (isArray(target) && !isArray(source)) { - mergeTarget = arrayToObject(target, options); + handleAuthentication(httpClient, requestInfo, objs) { + return null; } +} +exports.BearerCredentialHandler = BearerCredentialHandler; - if (isArray(target) && isArray(source)) { - source.forEach(function (item, i) { - if (has.call(target, i)) { - var targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - return Object.keys(source).reduce(function (acc, key) { - var value = source[key]; +/***/ }), - if (has.call(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -}; +/***/ 4157: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var assign = function assignSingleSource(target, source) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -}; +"use strict"; -var decode = function (str, decoder, charset) { - var strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NtlmCredentialHandler = void 0; +const http = __nccwpck_require__(3685); +const https = __nccwpck_require__(5687); +const _ = __nccwpck_require__(5067); +const ntlm = __nccwpck_require__(2673); +class NtlmCredentialHandler { + constructor(username, password, workstation, domain) { + this._ntlmOptions = {}; + this._ntlmOptions.username = username; + this._ntlmOptions.password = password; + this._ntlmOptions.domain = domain || ''; + this._ntlmOptions.workstation = workstation || ''; } - // utf-8 - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; + prepareRequest(options) { + // No headers or options need to be set. We keep the credentials on the handler itself. + // If a (proxy) agent is set, remove it as we don't support proxy for NTLM at this time + if (options.agent) { + delete options.agent; + } } -}; - -var encode = function encode(str, defaultEncoder, charset, kind, format) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; + canHandleAuthentication(response) { + if (response && response.message && response.message.statusCode === 401) { + // Ensure that we're talking NTLM here + // Once we have the www-authenticate header, split it so we can ensure we can talk NTLM + const wwwAuthenticate = response.message.headers['www-authenticate']; + return wwwAuthenticate && (wwwAuthenticate.split(', ').indexOf("NTLM") >= 0); + } + return false; } - - var string = str; - if (typeof str === 'symbol') { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== 'string') { - string = String(str); + handleAuthentication(httpClient, requestInfo, objs) { + return new Promise((resolve, reject) => { + const callbackForResult = function (err, res) { + if (err) { + reject(err); + return; + } + // We have to readbody on the response before continuing otherwise there is a hang. + res.readBody().then(() => { + resolve(res); + }); + }; + this.handleAuthenticationPrivate(httpClient, requestInfo, objs, callbackForResult); + }); } - - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + handleAuthenticationPrivate(httpClient, requestInfo, objs, finalCallback) { + // Set up the headers for NTLM authentication + requestInfo.options = _.extend(requestInfo.options, { + username: this._ntlmOptions.username, + password: this._ntlmOptions.password, + domain: this._ntlmOptions.domain, + workstation: this._ntlmOptions.workstation + }); + requestInfo.options.agent = httpClient.isSsl ? + new https.Agent({ keepAlive: true }) : + new http.Agent({ keepAlive: true }); + let self = this; + // The following pattern of sending the type1 message following immediately (in a setImmediate) is + // critical for the NTLM exchange to happen. If we removed setImmediate (or call in a different manner) + // the NTLM exchange will always fail with a 401. + this.sendType1Message(httpClient, requestInfo, objs, function (err, res) { + if (err) { + return finalCallback(err, null, null); + } + /// We have to readbody on the response before continuing otherwise there is a hang. + res.readBody().then(() => { + // It is critical that we have setImmediate here due to how connection requests are queued. + // If setImmediate is removed then the NTLM handshake will not work. + // setImmediate allows us to queue a second request on the same connection. If this second + // request is not queued on the connection when the first request finishes then node closes + // the connection. NTLM requires both requests to be on the same connection so we need this. + setImmediate(function () { + self.sendType3Message(httpClient, requestInfo, objs, res, finalCallback); + }); + }); }); } - - var out = ''; - for (var i = 0; i < string.length; ++i) { - var c = string.charCodeAt(i); - - if ( - c === 0x2D // - - || c === 0x2E // . - || c === 0x5F // _ - || c === 0x7E // ~ - || (c >= 0x30 && c <= 0x39) // 0-9 - || (c >= 0x41 && c <= 0x5A) // a-z - || (c >= 0x61 && c <= 0x7A) // A-Z - || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - out += string.charAt(i); - continue; - } - - if (c < 0x80) { - out = out + hexTable[c]; - continue; + // The following method is an adaptation of code found at https://github.com/SamDecrock/node-http-ntlm/blob/master/httpntlm.js + sendType1Message(httpClient, requestInfo, objs, finalCallback) { + const type1HexBuffer = ntlm.encodeType1(this._ntlmOptions.workstation, this._ntlmOptions.domain); + const type1msg = `NTLM ${type1HexBuffer.toString('base64')}`; + const type1options = { + headers: { + 'Connection': 'keep-alive', + 'Authorization': type1msg + }, + timeout: requestInfo.options.timeout || 0, + agent: requestInfo.httpModule, + }; + const type1info = {}; + type1info.httpModule = requestInfo.httpModule; + type1info.parsedUrl = requestInfo.parsedUrl; + type1info.options = _.extend(type1options, _.omit(requestInfo.options, 'headers')); + return httpClient.requestRawWithCallback(type1info, objs, finalCallback); + } + // The following method is an adaptation of code found at https://github.com/SamDecrock/node-http-ntlm/blob/master/httpntlm.js + sendType3Message(httpClient, requestInfo, objs, res, callback) { + if (!res.message.headers && !res.message.headers['www-authenticate']) { + throw new Error('www-authenticate not found on response of second request'); } - - if (c < 0x800) { - out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); - continue; + /** + * Server will respond with challenge/nonce + * assigned to response's "WWW-AUTHENTICATE" header + * and should adhere to RegExp /^NTLM\s+(.+?)(,|\s+|$)/ + */ + const serverNonceRegex = /^NTLM\s+(.+?)(,|\s+|$)/; + const serverNonce = Buffer.from((res.message.headers['www-authenticate'].match(serverNonceRegex) || [])[1], 'base64'); + let type2msg; + /** + * Wrap decoding the Server's challenge/nonce in + * try-catch block to throw more comprehensive + * Error with clear message to consumer + */ + try { + type2msg = ntlm.decodeType2(serverNonce); } - - if (c < 0xD800 || c >= 0xE000) { - out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); - continue; + catch (error) { + throw new Error(`Decoding Server's Challenge to Obtain Type2Message failed with error: ${error.message}`); } - - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - /* eslint operator-linebreak: [2, "before"] */ - out += hexTable[0xF0 | (c >> 18)] - + hexTable[0x80 | ((c >> 12) & 0x3F)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; + const type3msg = ntlm.encodeType3(this._ntlmOptions.username, this._ntlmOptions.workstation, this._ntlmOptions.domain, type2msg, this._ntlmOptions.password).toString('base64'); + const type3options = { + headers: { + 'Authorization': `NTLM ${type3msg}`, + 'Connection': 'Close' + }, + agent: requestInfo.httpModule, + }; + const type3info = {}; + type3info.httpModule = requestInfo.httpModule; + type3info.parsedUrl = requestInfo.parsedUrl; + type3options.headers = _.extend(type3options.headers, requestInfo.options.headers); + type3info.options = _.extend(type3options, _.omit(requestInfo.options, 'headers')); + return httpClient.requestRawWithCallback(type3info, objs, callback); } +} +exports.NtlmCredentialHandler = NtlmCredentialHandler; - return out; -}; -var compact = function compact(value) { - var queue = [{ obj: { o: value }, prop: 'o' }]; - var refs = []; +/***/ }), - for (var i = 0; i < queue.length; ++i) { - var item = queue[i]; - var obj = item.obj[item.prop]; +/***/ 7799: +/***/ ((__unused_webpack_module, exports) => { - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; ++j) { - var key = keys[j]; - var val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } +"use strict"; + +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PersonalAccessTokenCredentialHandler = void 0; +class PersonalAccessTokenCredentialHandler { + constructor(token, allowCrossOriginAuthentication) { + this.token = token; + this.allowCrossOriginAuthentication = allowCrossOriginAuthentication; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!this.origin) { + this.origin = options.host; + } + // If this is a redirection, don't set the Authorization header + if (this.origin === options.host || this.allowCrossOriginAuthentication) { + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; } + options.headers['X-TFS-FedAuthRedirect'] = 'Suppress'; } - - compactQueue(queue); - - return value; -}; - -var isRegExp = function isRegExp(obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; - -var isBuffer = function isBuffer(obj) { - if (!obj || typeof obj !== 'object') { + // This handler cannot handle 401 + canHandleAuthentication(response) { return false; } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -}; - -var combine = function combine(a, b) { - return [].concat(a, b); -}; - -var maybeMap = function maybeMap(val, fn) { - if (isArray(val)) { - var mapped = []; - for (var i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i])); - } - return mapped; + handleAuthentication(httpClient, requestInfo, objs) { + return null; } - return fn(val); -}; - -module.exports = { - arrayToObject: arrayToObject, - assign: assign, - combine: combine, - compact: compact, - decode: decode, - encode: encode, - isBuffer: isBuffer, - isRegExp: isRegExp, - maybeMap: maybeMap, - merge: merge -}; +} +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; /***/ }), @@ -60412,7 +74131,7 @@ function oddpar(buf) */ function expandkey(key56) { - var key64 = new Buffer(8); + var key64 = Buffer.alloc(8); key64[0] = key56[0] & 0xFE; key64[1] = ((key56[0] << 7) & 0xFF) | (key56[1] >> 1); @@ -60431,7 +74150,7 @@ function expandkey(key56) */ function bintohex(bin) { - var buf = (Buffer.isBuffer(buf) ? buf : new Buffer(bin, 'binary')); + var buf = (Buffer.isBuffer(buf) ? buf : Buffer.from(bin, 'binary')); var str = buf.toString('hex').toUpperCase(); return zeroextend(str, 32); } @@ -60454,6 +74173,7 @@ var $ = __nccwpck_require__(2352); var lmhashbuf = (__nccwpck_require__(8657).lmhashbuf); var nthashbuf = (__nccwpck_require__(8657).nthashbuf); +var desjs = __nccwpck_require__(8743); function encodeType1(hostname, ntdomain) { hostname = hostname.toUpperCase(); @@ -60462,7 +74182,7 @@ function encodeType1(hostname, ntdomain) { var ntdomainlen = Buffer.byteLength(ntdomain, 'ascii'); var pos = 0; - var buf = new Buffer(32 + hostnamelen + ntdomainlen); + var buf = Buffer.alloc(32 + hostnamelen + ntdomainlen); buf.write('NTLMSSP', pos, 7, 'ascii'); // byte protocol[8]; pos += 7; @@ -60536,10 +74256,10 @@ function encodeType3(username, hostname, ntdomain, nonce, password) { hostname = hostname.toUpperCase(); ntdomain = ntdomain.toUpperCase(); - var lmh = new Buffer(21); + var lmh = Buffer.alloc(21); lmhashbuf(password).copy(lmh); lmh.fill(0x00, 16); // null pad to 21 bytes - var nth = new Buffer(21); + var nth = Buffer.alloc(21); nthashbuf(password).copy(nth); nth.fill(0x00, 16); // null pad to 21 bytes @@ -60560,7 +74280,7 @@ function encodeType3(username, hostname, ntdomain, nonce, password) { var pos = 0; var msg_len = 64 + ntdomainlen + usernamelen + hostnamelen + lmrlen + ntrlen; - var buf = new Buffer(msg_len); + var buf = Buffer.alloc(msg_len); buf.write('NTLMSSP', pos, 7, 'ascii'); // byte protocol[8]; pos += 7; @@ -60639,12 +74359,17 @@ function encodeType3(username, hostname, ntdomain, nonce, password) { function makeResponse(hash, nonce) { - var out = new Buffer(24); + var out = Buffer.alloc(24); + for (var i = 0; i < 3; i++) { var keybuf = $.oddpar($.expandkey(hash.slice(i * 7, i * 7 + 7))); - var des = crypto.createCipheriv('DES-ECB', keybuf, ''); - var str = des.update(nonce.toString('binary'), 'binary', 'binary'); - out.write(str, i * 8, i * 8 + 8, 'binary'); + + var des = desjs.DES.create({type: 'encrypt', key: keybuf}); + var magicKey = Buffer.from(nonce.toString('binary')); + var insertBuff = Buffer.from(des.update(magicKey)); + + out.fill(insertBuff, i * 8, i * 8 + 8, 'binary'); + } return out; } @@ -60660,7 +74385,7 @@ exports.challengeHeader = function (hostname, domain) { }; exports.responseHeader = function (res, url, domain, username, password) { - var serverNonce = new Buffer((res.headers['www-authenticate'].match(/^NTLM\s+(.+?)(,|\s+|$)/) || [])[1], 'base64'); + var serverNonce = Buffer.from((res.headers['www-authenticate'].match(/^NTLM\s+(.+?)(,|\s+|$)/) || [])[1], 'base64'); var hostname = (__nccwpck_require__(7310).parse)(url).hostname; return 'NTLM ' + exports.encodeType3(username, hostname, domain, exports.decodeType2(serverNonce), password).toString('base64') }; @@ -60675,9 +74400,11 @@ exports.smbhash = __nccwpck_require__(8657); /***/ 8657: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var crypto = __nccwpck_require__(6113); var $ = __nccwpck_require__(2352); +var jsmd4 = __nccwpck_require__(561); +var desjs = __nccwpck_require__(8743); + /* * Generate the LM Hash */ @@ -60688,7 +74415,7 @@ function lmhashbuf(inputstr) var xl = Buffer.byteLength(x, 'ascii'); /* null pad to 14 bytes */ - var y = new Buffer(14); + var y = Buffer.alloc(14); y.write(x, 0, xl, 'ascii'); y.fill(0, xl); @@ -60701,12 +74428,13 @@ function lmhashbuf(inputstr) /* DES encrypt magic number "KGS!@#$%" to two * 8-byte ciphertexts, (ECB, no padding) */ - var buf = new Buffer(16); + var buf = Buffer.alloc(16); var pos = 0; var cts = halves.forEach(function(z) { - var des = crypto.createCipheriv('DES-ECB', z, ''); - var str = des.update('KGS!@#$%', 'binary', 'binary'); - buf.write(str, pos, pos + 8, 'binary'); + var des = desjs.DES.create({type: 'encrypt', key: z}); + var magicKey = Buffer.from('KGS!@#$%', 'ascii'); + var insertBuff = Buffer.from(des.update(magicKey)); + buf.fill(insertBuff, pos, pos + 8, 'binary'); pos += 8; }); @@ -60718,10 +74446,10 @@ function lmhashbuf(inputstr) function nthashbuf(str) { /* take MD4 hash of UCS-2 encoded password */ - var ucs2 = new Buffer(str, 'ucs2'); - var md4 = crypto.createHash('md4'); + var ucs2 = Buffer.from(str, 'ucs2'); + var md4 = jsmd4.create(); md4.update(ucs2); - return new Buffer(md4.digest('binary'), 'binary'); + return Buffer.from(md4.digest('binary'), 'binary'); } function lmhash(is) @@ -61397,6 +75125,14 @@ module.exports = require("assert"); /***/ }), +/***/ 4300: +/***/ ((module) => { + +"use strict"; +module.exports = require("buffer"); + +/***/ }), + /***/ 6113: /***/ ((module) => { @@ -61504,21 +75240,21 @@ module.exports = require("zlib"); /***/ 6717: /***/ ((__unused_webpack_module, exports) => { -// Underscore.js 1.13.1 +// Underscore.js 1.13.7 // https://underscorejs.org -// (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors +// (c) 2009-2024 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. Object.defineProperty(exports, "__esModule", ({ value: true })); // Current version. -var VERSION = '1.13.1'; +var VERSION = '1.13.7'; // Establish the root object, `window` (`self`) in the browser, `global` // on the server, or `this` in some virtual machines. We use `self` // instead of `window` for `WebWorker` support. -var root = typeof self == 'object' && self.self === self && self || - typeof global == 'object' && global.global === global && global || +var root = (typeof self == 'object' && self.self === self && self) || + (typeof global == 'object' && global.global === global && global) || Function('return this')() || {}; @@ -61586,7 +75322,7 @@ function restArguments(func, startIndex) { // Is a given variable an object? function isObject(obj) { var type = typeof obj; - return type === 'function' || type === 'object' && !!obj; + return type === 'function' || (type === 'object' && !!obj); } // Is a given value equal to null? @@ -61649,8 +75385,11 @@ var hasObjectTag = tagTester('Object'); // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. // In IE 11, the most common among them, this problem also applies to // `Map`, `WeakMap` and `Set`. -var hasStringTagBug = ( - supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8))) +// Also, there are cases where an application can override the native +// `DataView` object, in cases like that we can't use the constructor +// safely and should just rely on alternate `DataView` checks +var hasDataViewBug = ( + supportsDataView && (!/\[native code\]/.test(String(DataView)) || hasObjectTag(new DataView(new ArrayBuffer(8)))) ), isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map)); @@ -61658,11 +75397,13 @@ var isDataView = tagTester('DataView'); // In IE 10 - Edge 13, we need a different heuristic // to determine whether an object is a `DataView`. -function ie10IsDataView(obj) { +// Also, in cases where the native `DataView` is +// overridden we can't rely on the tag itself. +function alternateIsDataView(obj) { return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer); } -var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView); +var isDataView$1 = (hasDataViewBug ? alternateIsDataView : isDataView); // Is a given value an array? // Delegates to ECMA5's native `Array.isArray`. @@ -61748,7 +75489,7 @@ function emulatedSet(keys) { var hash = {}; for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; return { - contains: function(key) { return hash[key]; }, + contains: function(key) { return hash[key] === true; }, push: function(key) { hash[key] = true; return keys.push(key); @@ -61763,7 +75504,7 @@ function collectNonEnumProps(obj, keys) { keys = emulatedSet(keys); var nonEnumIdx = nonEnumerableProps.length; var constructor = obj.constructor; - var proto = isFunction$1(constructor) && constructor.prototype || ObjProto; + var proto = (isFunction$1(constructor) && constructor.prototype) || ObjProto; // Constructor is a special case. var prop = 'constructor'; @@ -61875,7 +75616,7 @@ function deepEq(a, b, aStack, bStack) { var className = toString.call(a); if (className !== toString.call(b)) return false; // Work around a bug in IE 10 - Edge 13. - if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { + if (hasDataViewBug && className == '[object Object]' && isDataView$1(a)) { if (!isDataView$1(b)) return false; className = tagDataView; } @@ -62966,7 +76707,7 @@ function where(obj, attrs) { function max(obj, iteratee, context) { var result = -Infinity, lastComputed = -Infinity, value, computed; - if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { obj = isArrayLike(obj) ? obj : values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; @@ -62978,7 +76719,7 @@ function max(obj, iteratee, context) { iteratee = cb(iteratee, context); each(obj, function(v, index, list) { computed = iteratee(v, index, list); - if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { result = v; lastComputed = computed; } @@ -62991,7 +76732,7 @@ function max(obj, iteratee, context) { function min(obj, iteratee, context) { var result = Infinity, lastComputed = Infinity, value, computed; - if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { obj = isArrayLike(obj) ? obj : values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; @@ -63003,7 +76744,7 @@ function min(obj, iteratee, context) { iteratee = cb(iteratee, context); each(obj, function(v, index, list) { computed = iteratee(v, index, list); - if (computed < lastComputed || computed === Infinity && result === Infinity) { + if (computed < lastComputed || (computed === Infinity && result === Infinity)) { result = v; lastComputed = computed; } @@ -63012,6 +76753,19 @@ function min(obj, iteratee, context) { return result; } +// Safely create a real, live array from anything iterable. +var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; +function toArray(obj) { + if (!obj) return []; + if (isArray(obj)) return slice.call(obj); + if (isString(obj)) { + // Keep surrogate pair characters together. + return obj.match(reStrSymbol); + } + if (isArrayLike(obj)) return map(obj, identity); + return values(obj); +} + // Sample **n** random values from a collection using the modern version of the // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). // If **n** is not specified, returns a single random element. @@ -63021,7 +76775,7 @@ function sample(obj, n, guard) { if (!isArrayLike(obj)) obj = values(obj); return obj[random(obj.length - 1)]; } - var sample = isArrayLike(obj) ? clone(obj) : values(obj); + var sample = toArray(obj); var length = getLength(sample); n = Math.max(Math.min(n, length), 0); var last = length - 1; @@ -63098,19 +76852,6 @@ var partition = group(function(result, value, pass) { result[pass ? 0 : 1].push(value); }, true); -// Safely create a real, live array from anything iterable. -var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; -function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together. - return obj.match(reStrSymbol); - } - if (isArrayLike(obj)) return map(obj, identity); - return values(obj); -} - // Return the number of elements in a collection. function size(obj) { if (obj == null) return 0; @@ -63271,7 +77012,7 @@ function intersection(array) { // Complement of zip. Unzip accepts an array of arrays and groups // each array's elements on shared indices. function unzip(array) { - var length = array && max(array, getLength).length || 0; + var length = (array && max(array, getLength).length) || 0; var result = Array(length); for (var index = 0; index < length; index++) { @@ -63669,9 +77410,9 @@ exports.zip = zip; /***/ 5067: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Underscore.js 1.13.1 +// Underscore.js 1.13.7 // https://underscorejs.org -// (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors +// (c) 2009-2024 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. var underscoreNodeF = __nccwpck_require__(6717); diff --git a/dist/package.json b/dist/package.json index 80934bd9..cc5cf121 100644 --- a/dist/package.json +++ b/dist/package.json @@ -1,7 +1,7 @@ { "name": "azure-devops-node-api", "description": "Node client for Azure DevOps and TFS REST APIs", - "version": "11.0.1", + "version": "15.1.1", "main": "./WebApi.js", "types": "./WebApi.d.ts", "scripts": { @@ -23,17 +23,22 @@ "Teddy Ward " ], "license": "MIT", + "engines": { + "node": ">= 16.0.0" + }, "dependencies": { "tunnel": "0.0.6", - "typed-rest-client": "^1.8.4" + "typed-rest-client": "2.1.0" }, "devDependencies": { + "@types/glob": "5.0.35", + "@types/minimatch": "3.0.3", "@types/mocha": "^2.2.44", - "@types/shelljs": "0.7.8", - "mocha": "^3.5.3", + "@types/node": "16.11.7", + "@types/shelljs": "0.8.5", + "mocha": "^10.4.0", "nock": "9.6.1", - "shelljs": "0.7.8", - "typescript": "3.1.5", - "@types/node": "8.9.2" + "shelljs": "^0.8.5", + "typescript": "4.0.2" } } diff --git a/lib/pipeline.runner.js b/lib/pipeline.runner.js index 5395bbc0..a018d15a 100644 --- a/lib/pipeline.runner.js +++ b/lib/pipeline.runner.js @@ -34,7 +34,6 @@ const azdev = __importStar(require("azure-devops-node-api")); const task_parameters_1 = require("./task.parameters"); const pipeline_error_1 = require("./pipeline.error"); const ReleaseInterfaces = __importStar(require("azure-devops-node-api/interfaces/ReleaseInterfaces")); -const BuildInterfaces = __importStar(require("azure-devops-node-api/interfaces/BuildInterfaces")); const pipeline_helper_1 = require("./util/pipeline.helper"); const logger_1 = require("./util/logger"); const url_parser_1 = require("./util/url.parser"); @@ -80,59 +79,58 @@ class PipelineRunner { return __awaiter(this, void 0, void 0, function* () { let projectName = url_parser_1.UrlParser.GetProjectName(this.taskParameters.azureDevopsProjectUrl); let pipelineName = this.taskParameters.azurePipelineName; - let buildApi = yield webApi.getBuildApi(); - // Get matching build definitions for the given project and pipeline name - const buildDefinitions = yield buildApi.getDefinitions(projectName, pipelineName); - pipeline_helper_1.PipelineHelper.EnsureValidPipeline(projectName, pipelineName, buildDefinitions); - // Extract Id from build definition - let buildDefinitionReference = buildDefinitions[0]; - let buildDefinitionId = buildDefinitionReference.id; - // Get build definition for the matching definition Id - let buildDefinition = yield buildApi.getDefinition(projectName, buildDefinitionId); - logger_1.Logger.LogPipelineObject(buildDefinition); - // Fetch repository details from build definition - let repositoryId = buildDefinition.repository.id.trim(); - let repositoryType = buildDefinition.repository.type.trim(); - let sourceBranch = null; - let sourceVersion = null; - // If definition is linked to existing github repo, pass github source branch and source version to build - if (pipeline_helper_1.PipelineHelper.equals(repositoryId, this.repository) && pipeline_helper_1.PipelineHelper.equals(repositoryType, this.githubRepo)) { - core.debug("pipeline is linked to same Github repo"); - sourceBranch = this.branch, - sourceVersion = this.commitId; + let pipelinesApi = yield webApi.getPipelinesApi(); + // Get all pipelines for the project + const pipelines = yield pipelinesApi.listPipelines(projectName); + // Find the pipeline by name + const pipeline = pipelines.find((x) => x.name === pipelineName); + if (!pipeline) { + throw new pipeline_error_1.PipelineNotFoundError(`Pipeline "${pipelineName}" not found in project "${projectName}"`); } - else { - core.debug("pipeline is not linked to same Github repo"); - } - let build = { - definition: { - id: buildDefinition.id - }, - project: { - id: buildDefinition.project.id - }, - sourceBranch: sourceBranch, - sourceVersion: sourceVersion, - reason: BuildInterfaces.BuildReason.Triggered, - parameters: this.taskParameters.azurePipelineVariables + pipeline_helper_1.PipelineHelper.EnsureValidPipeline(projectName, pipelineName, [pipeline]); + logger_1.Logger.LogPipelineObject(pipeline); + // Prepare run parameters + let runParameters = { + variables: undefined, + resources: { + repositories: { + self: { + refName: this.branch, + version: this.commitId + } + } + } }; - logger_1.Logger.LogPipelineTriggerInput(build); - // Queue build - let buildQueueResult = yield buildApi.queueBuild(build, build.project.id, true); - if (buildQueueResult != null) { - logger_1.Logger.LogPipelineTriggerOutput(buildQueueResult); - // If build result contains validation errors set result to FAILED - if (buildQueueResult.validationResults != null && buildQueueResult.validationResults.length > 0) { - let errorAndWarningMessage = pipeline_helper_1.PipelineHelper.getErrorAndWarningMessageFromBuildResult(buildQueueResult.validationResults); - core.setFailed("Errors: " + errorAndWarningMessage.errorMessage + " Warnings: " + errorAndWarningMessage.warningMessage); + // Set variables if provided + if (this.taskParameters.azurePipelineVariables) { + try { + const varsJson = JSON.parse(this.taskParameters.azurePipelineVariables); + // Convert to Pipeline API format: {key: {value: string, isSecret?: boolean}} + runParameters.variables = {}; + Object.keys(varsJson).forEach(key => { + runParameters.variables[key] = { value: varsJson[key] }; + }); } - else { - logger_1.Logger.LogPipelineTriggered(pipelineName, projectName); - if (buildQueueResult._links != null) { - logger_1.Logger.LogOutputUrl(buildQueueResult._links.web.href); - } + catch (e) { + core.warning("Failed to parse pipeline variables: " + e.message); + } + } + if (this.taskParameters.azurePipelineParameters) { + try { + runParameters.templateParameters = JSON.parse(this.taskParameters.azurePipelineParameters); + } + catch (e) { + core.warning("Failed to parse pipeline template parameters: " + e.message); } } + logger_1.Logger.LogPipelineTriggerInput(runParameters); + // Run pipeline + const runResult = yield pipelinesApi.runPipeline(runParameters, projectName, pipeline.id); + logger_1.Logger.LogPipelineTriggered(pipelineName, projectName); + logger_1.Logger.LogPipelineTriggerOutput(runResult); + if (runResult._links && runResult._links.web) { + logger_1.Logger.LogOutputUrl(runResult._links.web.href); + } }); } RunDesignerPipeline(webApi) { diff --git a/lib/task.parameters.js b/lib/task.parameters.js index 8775ac42..159d564c 100644 --- a/lib/task.parameters.js +++ b/lib/task.parameters.js @@ -26,6 +26,7 @@ class TaskParameters { this._azureDevopsProjectUrl = core.getInput('azure-devops-project-url', { required: true }); this._azurePipelineName = core.getInput('azure-pipeline-name', { required: true }); this._azureDevopsToken = core.getInput('azure-devops-token', { required: true }); + this._azurePipelineParameters = core.getInput('azure-pipeline-parameters', { required: false }); this._azurePipelineVariables = core.getInput('azure-pipeline-variables', { required: false }); } static getTaskParams() { @@ -46,5 +47,8 @@ class TaskParameters { get azurePipelineVariables() { return this._azurePipelineVariables; } + get azurePipelineParameters() { + return this._azurePipelineParameters; + } } exports.TaskParameters = TaskParameters; diff --git a/package-lock.json b/package-lock.json index 045002f2..bedf4066 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@types/jest": "^26.0.1", "@types/node": "^12.12.6", "@vercel/ncc": "^0.36.0", - "azure-devops-node-api": "11.0.1", + "azure-devops-node-api": "^15.1.1", "jest": "^26.0.1", "ts-jest": "^26.0.1", "typescript": "^3.5.2" @@ -1156,13 +1156,17 @@ } }, "node_modules/azure-devops-node-api": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.0.1.tgz", - "integrity": "sha512-YMdjAw9l5p/6leiyIloxj3k7VIvYThKjvqgiQn88r3nhT93ENwsoDS3A83CyJ4uTWzCZ5f5jCi6c27rTU5Pz+A==", + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-15.1.1.tgz", + "integrity": "sha512-ohL2CY+zRAItKvwkHhefYxjr0Hndu6s8qKwyl0+wL4Ol6c4UrsI3A3G6ZPwwK81c1Ga3dEXjeDg4aKV4hn9loA==", "dev": true, + "license": "MIT", "dependencies": { "tunnel": "0.0.6", - "typed-rest-client": "^1.8.4" + "typed-rest-client": "2.1.0" + }, + "engines": { + "node": ">= 16.0.0" } }, "node_modules/babel-jest": { @@ -1435,14 +1439,32 @@ "node": ">=0.10.0" } }, - "node_modules/call-bind": { + "node_modules/call-bind-apply-helpers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, + "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1843,6 +1865,17 @@ "node": ">=0.4.0" } }, + "node_modules/des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -1882,6 +1915,21 @@ "node": ">=8" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/emittery": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", @@ -1918,6 +1966,39 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -2304,10 +2385,14 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gensync": { "version": "1.0.0-beta.2", @@ -2328,14 +2413,25 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, + "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2350,6 +2446,20 @@ "node": ">=8.0.0" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -2400,6 +2510,19 @@ "node": ">=4" } }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", @@ -2435,10 +2558,11 @@ } }, "node_modules/has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2509,6 +2633,19 @@ "node": ">=0.10.0" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -3603,6 +3740,13 @@ "node": ">= 10.14.2" } }, + "node_modules/js-md4": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/js-md4/-/js-md4-0.3.2.tgz", + "integrity": "sha512-/GDnfQYsltsjRswQhN9fhv3EMw2sCpUdrdxyWDOUK7eyD++r3gRhzgiQgc/x4MAv2i1iuQ4lxO5mvqM3vj4bwA==", + "dev": true, + "license": "MIT" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3825,6 +3969,16 @@ "node": ">=0.10.0" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -3874,6 +4028,13 @@ "node": ">=6" } }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true, + "license": "ISC" + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -4127,10 +4288,14 @@ } }, "node_modules/object-inspect": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", - "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4430,6 +4595,22 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -4874,14 +5055,76 @@ "optional": true }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5515,30 +5758,20 @@ } }, "node_modules/typed-rest-client": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.5.tgz", - "integrity": "sha512-952/Aegu3lTqUAI1anbDLbewojnF/gh8at9iy1CIrfS1h/+MtNjB1Y9z6ZF5n2kZd+97em56lZ9uu7Zz3y/pwg==", - "deprecated": "1.8.5 contains changes that are not compatible with Node 6", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-2.1.0.tgz", + "integrity": "sha512-Nel9aPbgSzRxfs1+4GoSB4wexCF+4Axlk7OSGVQCMa+4fWcyxIsN/YNmkp0xTT2iQzMD98h8yFLav/cNaULmRA==", "dev": true, + "license": "MIT", "dependencies": { - "qs": "^6.9.1", + "des.js": "^1.1.0", + "js-md4": "^0.3.2", + "qs": "^6.10.3", "tunnel": "0.0.6", "underscore": "^1.12.1" - } - }, - "node_modules/typed-rest-client/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" }, "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 16.0.0" } }, "node_modules/typedarray-to-buffer": { @@ -5564,10 +5797,11 @@ } }, "node_modules/underscore": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz", - "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==", - "dev": true + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", + "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==", + "dev": true, + "license": "MIT" }, "node_modules/union-value": { "version": "1.0.1", @@ -6866,13 +7100,13 @@ "dev": true }, "azure-devops-node-api": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.0.1.tgz", - "integrity": "sha512-YMdjAw9l5p/6leiyIloxj3k7VIvYThKjvqgiQn88r3nhT93ENwsoDS3A83CyJ4uTWzCZ5f5jCi6c27rTU5Pz+A==", + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-15.1.1.tgz", + "integrity": "sha512-ohL2CY+zRAItKvwkHhefYxjr0Hndu6s8qKwyl0+wL4Ol6c4UrsI3A3G6ZPwwK81c1Ga3dEXjeDg4aKV4hn9loA==", "dev": true, "requires": { "tunnel": "0.0.6", - "typed-rest-client": "^1.8.4" + "typed-rest-client": "2.1.0" } }, "babel-jest": { @@ -7094,14 +7328,24 @@ "unset-value": "^1.0.0" } }, - "call-bind": { + "call-bind-apply-helpers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" } }, "callsites": { @@ -7413,6 +7657,16 @@ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true }, + "des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -7442,6 +7696,17 @@ } } }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, "emittery": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", @@ -7472,6 +7737,27 @@ "is-arrayish": "^0.2.1" } }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -7772,9 +8058,9 @@ "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true }, "gensync": { @@ -7790,14 +8076,21 @@ "dev": true }, "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" } }, "get-package-type": { @@ -7806,6 +8099,16 @@ "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -7841,6 +8144,12 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true + }, "graceful-fs": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", @@ -7870,9 +8179,9 @@ "dev": true }, "has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true }, "has-value": { @@ -7927,6 +8236,15 @@ } } }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, "hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -8778,6 +9096,12 @@ "supports-color": "^7.0.0" } }, + "js-md4": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/js-md4/-/js-md4-0.3.2.tgz", + "integrity": "sha512-/GDnfQYsltsjRswQhN9fhv3EMw2sCpUdrdxyWDOUK7eyD++r3gRhzgiQgc/x4MAv2i1iuQ4lxO5mvqM3vj4bwA==", + "dev": true + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -8944,6 +9268,12 @@ "object-visit": "^1.0.0" } }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -8981,6 +9311,12 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -9188,9 +9524,9 @@ } }, "object-inspect": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", - "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true }, "object-visit": { @@ -9407,6 +9743,15 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "dev": true, + "requires": { + "side-channel": "^1.1.0" + } + }, "react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -9765,14 +10110,51 @@ "optional": true }, "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" } }, "signal-exit": { @@ -10276,25 +10658,16 @@ "dev": true }, "typed-rest-client": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.5.tgz", - "integrity": "sha512-952/Aegu3lTqUAI1anbDLbewojnF/gh8at9iy1CIrfS1h/+MtNjB1Y9z6ZF5n2kZd+97em56lZ9uu7Zz3y/pwg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-2.1.0.tgz", + "integrity": "sha512-Nel9aPbgSzRxfs1+4GoSB4wexCF+4Axlk7OSGVQCMa+4fWcyxIsN/YNmkp0xTT2iQzMD98h8yFLav/cNaULmRA==", "dev": true, "requires": { - "qs": "^6.9.1", + "des.js": "^1.1.0", + "js-md4": "^0.3.2", + "qs": "^6.10.3", "tunnel": "0.0.6", "underscore": "^1.12.1" - }, - "dependencies": { - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "requires": { - "side-channel": "^1.0.4" - } - } } }, "typedarray-to-buffer": { @@ -10313,9 +10686,9 @@ "dev": true }, "underscore": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz", - "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==", + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", + "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==", "dev": true }, "union-value": { diff --git a/package.json b/package.json index 7cfb7974..4e3ad0a6 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ "devDependencies": { "@types/jest": "^26.0.1", "@types/node": "^12.12.6", - "azure-devops-node-api": "11.0.1", + "@vercel/ncc": "^0.36.0", + "azure-devops-node-api": "^15.1.1", "jest": "^26.0.1", "ts-jest": "^26.0.1", - "typescript": "^3.5.2", - "@vercel/ncc": "^0.36.0" + "typescript": "^3.5.2" }, "scripts": { "build": "tsc", diff --git a/src/pipeline.runner.ts b/src/pipeline.runner.ts index 6030ce5e..2d4cdb55 100644 --- a/src/pipeline.runner.ts +++ b/src/pipeline.runner.ts @@ -4,7 +4,7 @@ import { TaskParameters } from './task.parameters'; import { PipelineNotFoundError } from './pipeline.error'; import * as ReleaseInterfaces from 'azure-devops-node-api/interfaces/ReleaseInterfaces'; -import * as BuildInterfaces from 'azure-devops-node-api/interfaces/BuildInterfaces'; +import * as PipelineInterfaces from 'azure-devops-node-api/interfaces/PipelinesInterfaces'; import { PipelineHelper as p } from './util/pipeline.helper'; import { Logger as log } from './util/logger'; import { UrlParser } from './util/url.parser'; @@ -51,68 +51,65 @@ export class PipelineRunner { public async RunYamlPipeline(webApi: azdev.WebApi): Promise { let projectName = UrlParser.GetProjectName(this.taskParameters.azureDevopsProjectUrl); let pipelineName = this.taskParameters.azurePipelineName; - let buildApi = await webApi.getBuildApi(); + let pipelinesApi = await webApi.getPipelinesApi(); - // Get matching build definitions for the given project and pipeline name - const buildDefinitions = await buildApi.getDefinitions(projectName, pipelineName); + // Get all pipelines for the project + const pipelines = await pipelinesApi.listPipelines(projectName); + // Find the pipeline by name + const pipeline = pipelines.find((x: PipelineInterfaces.PipelineReference) => x.name === pipelineName); - p.EnsureValidPipeline(projectName, pipelineName, buildDefinitions); - - // Extract Id from build definition - let buildDefinitionReference: BuildInterfaces.BuildDefinitionReference = buildDefinitions[0]; - let buildDefinitionId = buildDefinitionReference.id; + if (!pipeline) { + throw new PipelineNotFoundError(`Pipeline "${pipelineName}" not found in project "${projectName}"`); + } - // Get build definition for the matching definition Id - let buildDefinition = await buildApi.getDefinition(projectName, buildDefinitionId); + p.EnsureValidPipeline(projectName, pipelineName, [pipeline]); - log.LogPipelineObject(buildDefinition); + log.LogPipelineObject(pipeline); - // Fetch repository details from build definition - let repositoryId = buildDefinition.repository.id.trim(); - let repositoryType = buildDefinition.repository.type.trim(); - let sourceBranch = null; - let sourceVersion = null; + // Prepare run parameters + let runParameters: PipelineInterfaces.RunPipelineParameters = { + variables: undefined, + resources: { + repositories: { + self: { + refName: this.branch, + version: this.commitId + } + } + } + }; - // If definition is linked to existing github repo, pass github source branch and source version to build - if (p.equals(repositoryId, this.repository) && p.equals(repositoryType, this.githubRepo)) { - core.debug("pipeline is linked to same Github repo"); - sourceBranch = this.branch, - sourceVersion = this.commitId - } else { - core.debug("pipeline is not linked to same Github repo"); + // Set variables if provided + if (this.taskParameters.azurePipelineVariables) { + try { + const varsJson = JSON.parse(this.taskParameters.azurePipelineVariables); + // Convert to Pipeline API format: {key: {value: string, isSecret?: boolean}} + runParameters.variables = {}; + Object.keys(varsJson).forEach(key => { + runParameters.variables![key] = { value: varsJson[key] }; + }); + } catch (e) { + core.warning("Failed to parse pipeline variables: " + e.message); + } } - let build: BuildInterfaces.Build = { - definition: { - id: buildDefinition.id - }, - project: { - id: buildDefinition.project.id - }, - sourceBranch: sourceBranch, - sourceVersion: sourceVersion, - reason: BuildInterfaces.BuildReason.Triggered, - parameters: this.taskParameters.azurePipelineVariables - } as BuildInterfaces.Build; - - log.LogPipelineTriggerInput(build); - - // Queue build - let buildQueueResult = await buildApi.queueBuild(build, build.project.id, true); - if (buildQueueResult != null) { - log.LogPipelineTriggerOutput(buildQueueResult); - // If build result contains validation errors set result to FAILED - if (buildQueueResult.validationResults != null && buildQueueResult.validationResults.length > 0) { - let errorAndWarningMessage = p.getErrorAndWarningMessageFromBuildResult(buildQueueResult.validationResults); - core.setFailed("Errors: " + errorAndWarningMessage.errorMessage + " Warnings: " + errorAndWarningMessage.warningMessage); - } - else { - log.LogPipelineTriggered(pipelineName, projectName); - if (buildQueueResult._links != null) { - log.LogOutputUrl(buildQueueResult._links.web.href); - } + if (this.taskParameters.azurePipelineParameters) { + try { + runParameters.templateParameters = JSON.parse(this.taskParameters.azurePipelineParameters); + } catch (e) { + core.warning("Failed to parse pipeline template parameters: " + e.message); } } + + log.LogPipelineTriggerInput(runParameters); + + // Run pipeline + const runResult = await pipelinesApi.runPipeline(runParameters, projectName, pipeline.id!); + log.LogPipelineTriggered(pipelineName, projectName); + log.LogPipelineTriggerOutput(runResult); + if (runResult._links && runResult._links.web) { + log.LogOutputUrl(runResult._links.web.href); + } } public async RunDesignerPipeline(webApi: azdev.WebApi): Promise { diff --git a/src/task.parameters.ts b/src/task.parameters.ts index 8d485120..53d53354 100644 --- a/src/task.parameters.ts +++ b/src/task.parameters.ts @@ -6,11 +6,13 @@ export class TaskParameters { private _azurePipelineName: string; private _azureDevopsToken: string; private _azurePipelineVariables: string; + private _azurePipelineParameters: string; private constructor() { this._azureDevopsProjectUrl = core.getInput('azure-devops-project-url', { required: true }); this._azurePipelineName = core.getInput('azure-pipeline-name', { required: true }); this._azureDevopsToken = core.getInput('azure-devops-token', { required: true }); + this._azurePipelineParameters = core.getInput('azure-pipeline-parameters', { required: false }); this._azurePipelineVariables = core.getInput('azure-pipeline-variables', { required: false }); } @@ -37,4 +39,8 @@ export class TaskParameters { public get azurePipelineVariables() { return this._azurePipelineVariables; } + + public get azurePipelineParameters() { + return this._azurePipelineParameters; + } } \ No newline at end of file