Skip to content

Commit

Permalink
M216 API updates (#539)
Browse files Browse the repository at this point in the history
* M216 API updates

* Regenerated package lock file

* Revert "Regenerated package lock file"

This reverts commit 59ee5e4.

* Fixed npm install issue
  • Loading branch information
starkmsu authored Jan 18, 2023
1 parent 9ccac86 commit 16225eb
Show file tree
Hide file tree
Showing 29 changed files with 820 additions and 202 deletions.
2 changes: 1 addition & 1 deletion api/BuildApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3910,7 +3910,7 @@ export class BuildApi extends basem.ClientApiBase implements IBuildApi {
/**
* 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.
*/
Expand Down
2 changes: 1 addition & 1 deletion api/FileContainerApiBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class FileContainerApiBase extends basem.ClientApiBase implements IFileCo
}

/**
* Creates the specified items in in the referenced container.
* Creates the specified items in the referenced container.
*
* @param {VSSInterfaces.VssJsonCollectionWrapperV<FileContainerInterfaces.FileContainerItem[]>} items
* @param {number} containerId
Expand Down
40 changes: 40 additions & 0 deletions api/GalleryApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export interface IGalleryApi extends compatBase.GalleryCompatHttpClientBase {
getPublisher(publisherName: string, flags?: number): Promise<GalleryInterfaces.Publisher>;
updatePublisher(publisher: GalleryInterfaces.Publisher, publisherName: string): Promise<GalleryInterfaces.Publisher>;
updatePublisherMembers(roleAssignments: GalleryInterfaces.PublisherUserRoleAssignmentRef[], publisherName: string, limitToCallerIdentityDomain?: boolean): Promise<GalleryInterfaces.PublisherRoleAssignment[]>;
getPublisherWithoutToken(publisherName: string): Promise<GalleryInterfaces.Publisher>;
getQuestions(publisherName: string, extensionName: string, count?: number, page?: number, afterDate?: Date): Promise<GalleryInterfaces.QuestionsResult>;
reportQuestion(concern: GalleryInterfaces.Concern, pubName: string, extName: string, questionId: number): Promise<GalleryInterfaces.Concern>;
createQuestion(question: GalleryInterfaces.Question, publisherName: string, extensionName: string): Promise<GalleryInterfaces.Question>;
Expand Down Expand Up @@ -2825,6 +2826,45 @@ export class GalleryApi extends compatBase.GalleryCompatHttpClientBase implement
});
}

/**
* @param {string} publisherName
*/
public async getPublisherWithoutToken(
publisherName: string
): Promise<GalleryInterfaces.Publisher> {

return new Promise<GalleryInterfaces.Publisher>(async (resolve, reject) => {
let routeValues: any = {
publisherName: publisherName
};

try {
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
"7.1-preview.1",
"gallery",
"215a2ed8-458a-4850-ad5a-45f1dabc3461",
routeValues);

let url: string = verData.requestUrl!;
let options: restm.IRequestOptions = this.createRequestOptions('application/json',
verData.apiVersion);

let res: restm.IRestResponse<GalleryInterfaces.Publisher>;
res = await this.rest.get<GalleryInterfaces.Publisher>(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.
*
Expand Down
11 changes: 7 additions & 4 deletions api/GitApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface IGitApi extends basem.ClientApiBase {
updateImportRequest(importRequestToUpdate: GitInterfaces.GitImportRequest, project: string, repositoryId: string, importRequestId: number): Promise<GitInterfaces.GitImportRequest>;
getItem(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean, resolveLfs?: boolean, sanitize?: boolean): Promise<GitInterfaces.GitItem>;
getItemContent(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean, resolveLfs?: boolean, sanitize?: boolean): Promise<NodeJS.ReadableStream>;
getItems(repositoryId: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, includeLinks?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Promise<GitInterfaces.GitItem[]>;
getItems(repositoryId: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, includeLinks?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor, zipForUnix?: boolean): Promise<GitInterfaces.GitItem[]>;
getItemText(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean, resolveLfs?: boolean, sanitize?: boolean): Promise<NodeJS.ReadableStream>;
getItemZip(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean, resolveLfs?: boolean, sanitize?: boolean): Promise<NodeJS.ReadableStream>;
getItemsBatch(requestData: GitInterfaces.GitItemRequestData, repositoryId: string, project?: string): Promise<GitInterfaces.GitItem[][]>;
Expand Down Expand Up @@ -2058,6 +2058,7 @@ export class GitApi extends basem.ClientApiBase implements IGitApi {
* @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
*/
public async getItems(
repositoryId: string,
Expand All @@ -2068,7 +2069,8 @@ export class GitApi extends basem.ClientApiBase implements IGitApi {
latestProcessedChange?: boolean,
download?: boolean,
includeLinks?: boolean,
versionDescriptor?: GitInterfaces.GitVersionDescriptor
versionDescriptor?: GitInterfaces.GitVersionDescriptor,
zipForUnix?: boolean
): Promise<GitInterfaces.GitItem[]> {

return new Promise<GitInterfaces.GitItem[]>(async (resolve, reject) => {
Expand All @@ -2085,6 +2087,7 @@ export class GitApi extends basem.ClientApiBase implements IGitApi {
download: download,
includeLinks: includeLinks,
versionDescriptor: versionDescriptor,
zipForUnix: zipForUnix,
};

try {
Expand Down Expand Up @@ -3286,7 +3289,7 @@ export class GitApi extends basem.ClientApiBase implements IGitApi {

try {
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
"7.1-preview.1",
"7.1-preview.2",
"git",
"d43911ee-6958-46b0-a42b-8445b8a0d004",
routeValues);
Expand Down Expand Up @@ -3339,7 +3342,7 @@ export class GitApi extends basem.ClientApiBase implements IGitApi {

try {
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
"7.1-preview.1",
"7.1-preview.2",
"git",
"d43911ee-6958-46b0-a42b-8445b8a0d004",
routeValues,
Expand Down
9 changes: 3 additions & 6 deletions api/PolicyApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
import PolicyInterfaces = require("./interfaces/PolicyInterfaces");

export interface IPolicyApi extends basem.ClientApiBase {
createPolicyConfiguration(configuration: PolicyInterfaces.PolicyConfiguration, project: string, configurationId?: number): Promise<PolicyInterfaces.PolicyConfiguration>;
createPolicyConfiguration(configuration: PolicyInterfaces.PolicyConfiguration, project: string): Promise<PolicyInterfaces.PolicyConfiguration>;
deletePolicyConfiguration(project: string, configurationId: number): Promise<void>;
getPolicyConfiguration(project: string, configurationId: number): Promise<PolicyInterfaces.PolicyConfiguration>;
getPolicyConfigurations(project: string, scope?: string, policyType?: string): Promise<PolicyInterfaces.PolicyConfiguration[]>;
Expand All @@ -43,18 +43,15 @@ export class PolicyApi extends basem.ClientApiBase implements IPolicyApi {
*
* @param {PolicyInterfaces.PolicyConfiguration} configuration - The policy configuration to create.
* @param {string} project - Project ID or project name
* @param {number} configurationId
*/
public async createPolicyConfiguration(
configuration: PolicyInterfaces.PolicyConfiguration,
project: string,
configurationId?: number
project: string
): Promise<PolicyInterfaces.PolicyConfiguration> {

return new Promise<PolicyInterfaces.PolicyConfiguration>(async (resolve, reject) => {
let routeValues: any = {
project: project,
configurationId: configurationId
project: project
};

try {
Expand Down
39 changes: 0 additions & 39 deletions api/TaskAgentApiBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ export interface ITaskAgentApiBase extends basem.ClientApiBase {
updateVirtualMachineGroup(resource: TaskAgentInterfaces.VirtualMachineGroup, project: string, environmentId: number): Promise<TaskAgentInterfaces.VirtualMachineGroup>;
getVirtualMachines(project: string, environmentId: number, resourceId: number, continuationToken?: string, name?: string, partialNameMatch?: boolean, tags?: string[], top?: number): Promise<TaskAgentInterfaces.VirtualMachine[]>;
updateVirtualMachines(machines: TaskAgentInterfaces.VirtualMachine[], project: string, environmentId: number, resourceId: number): Promise<TaskAgentInterfaces.VirtualMachine[]>;
acquireAccessToken(authenticationRequest: TaskAgentInterfaces.AadOauthTokenRequest): Promise<TaskAgentInterfaces.AadOauthTokenResult>;
createAadOAuthRequest(tenantId: string, redirectUri: string, promptOption?: TaskAgentInterfaces.AadLoginPromptOption, completeCallbackPayload?: string, completeCallbackByAuthCode?: boolean): Promise<string>;
getVstsAadTenantId(): Promise<string>;
getYamlSchema(validateTaskNames?: boolean): Promise<any>;
Expand Down Expand Up @@ -7382,44 +7381,6 @@ export class TaskAgentApiBase extends basem.ClientApiBase implements ITaskAgentA
});
}

/**

This comment has been minimized.

Copy link
@mmajcica

mmajcica Jan 27, 2023

Why has this method been deleted? Is there another suggested way to achieve the same?

* @param {TaskAgentInterfaces.AadOauthTokenRequest} authenticationRequest
*/
public async acquireAccessToken(
authenticationRequest: TaskAgentInterfaces.AadOauthTokenRequest
): Promise<TaskAgentInterfaces.AadOauthTokenResult> {

return new Promise<TaskAgentInterfaces.AadOauthTokenResult>(async (resolve, reject) => {
let routeValues: any = {
};

try {
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
"7.1-preview.1",
"distributedtask",
"9c63205e-3a0f-42a0-ad88-095200f13607",
routeValues);

let url: string = verData.requestUrl!;
let options: restm.IRequestOptions = this.createRequestOptions('application/json',
verData.apiVersion);

let res: restm.IRestResponse<TaskAgentInterfaces.AadOauthTokenResult>;
res = await this.rest.create<TaskAgentInterfaces.AadOauthTokenResult>(url, authenticationRequest, options);

let ret = this.formatResponse(res.result,
null,
false);

resolve(ret);

}
catch (err) {
reject(err);
}
});
}

/**
* @param {string} tenantId
* @param {string} redirectUri
Expand Down
Loading

0 comments on commit 16225eb

Please sign in to comment.