Skip to content

Commit b0f028c

Browse files
authored
M234 API updates (#585)
* M234 API updates * fix import * update version
1 parent 37331db commit b0f028c

25 files changed

Lines changed: 637 additions & 236 deletions

api/AlertApi.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface IAlertApi extends basem.ClientApiBase {
2525
getAlertInstances(project: string, alertId: number, repository: string, ref?: string): Promise<AlertInterfaces.AlertAnalysisInstance[]>;
2626
uploadSarif(customHeaders: any, contentStream: NodeJS.ReadableStream, project: string, repository: string): Promise<number>;
2727
getUxFilters(project: string, repository: string, alertType: AlertInterfaces.AlertType): Promise<AlertInterfaces.UxFilters>;
28-
getSarif(sarifId: number): Promise<boolean>;
28+
getSarif(sarifId: number): Promise<AlertInterfaces.SarifUploadStatus>;
2929
}
3030

3131
export class AlertApi extends basem.ClientApiBase implements IAlertApi {
@@ -257,9 +257,11 @@ export class AlertApi extends basem.ClientApiBase implements IAlertApi {
257257
}
258258

259259
/**
260+
* Get instances of an alert.
261+
*
260262
* @param {string} project - Project ID or project name
261-
* @param {number} alertId
262-
* @param {string} repository
263+
* @param {number} alertId - ID of alert to retrieve
264+
* @param {string} repository - Name or id of a repository that alert is part of
263265
* @param {string} ref
264266
*/
265267
public async getAlertInstances(
@@ -418,16 +420,16 @@ export class AlertApi extends basem.ClientApiBase implements IAlertApi {
418420
*/
419421
public async getSarif(
420422
sarifId: number
421-
): Promise<boolean> {
423+
): Promise<AlertInterfaces.SarifUploadStatus> {
422424

423-
return new Promise<boolean>(async (resolve, reject) => {
425+
return new Promise<AlertInterfaces.SarifUploadStatus>(async (resolve, reject) => {
424426
let routeValues: any = {
425427
sarifId: sarifId
426428
};
427429

428430
try {
429431
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
430-
"7.2-preview.1",
432+
"7.2-preview.2",
431433
"Alert",
432434
"a04689e7-0f81-48a2-8d18-40654c47494c",
433435
routeValues);
@@ -436,11 +438,11 @@ export class AlertApi extends basem.ClientApiBase implements IAlertApi {
436438
let options: restm.IRequestOptions = this.createRequestOptions('application/json',
437439
verData.apiVersion);
438440

439-
let res: restm.IRestResponse<boolean>;
440-
res = await this.rest.get<boolean>(url, options);
441+
let res: restm.IRestResponse<AlertInterfaces.SarifUploadStatus>;
442+
res = await this.rest.get<AlertInterfaces.SarifUploadStatus>(url, options);
441443

442444
let ret = this.formatResponse(res.result,
443-
null,
445+
AlertInterfaces.TypeInfo.SarifUploadStatus,
444446
false);
445447

446448
resolve(ret);

api/ExtensionManagementApi.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@ export class ExtensionManagementApi extends basem.ClientApiBase implements IExte
5353
public static readonly RESOURCE_AREA_ID = "6c2b0933-3600-42ae-bf8b-93d4f7e83594";
5454

5555
/**
56-
* @param {string} itemId
57-
* @param {boolean} testCommerce
58-
* @param {boolean} isFreeOrTrialInstall
59-
* @param {boolean} isAccountOwner
60-
* @param {boolean} isLinked
61-
* @param {boolean} isConnectedServer
56+
* This API is called by acquisition/install page to get possible user actions like Buy/Request
57+
*
58+
* @param {string} itemId - Fully qualified name of extension (<publisher_id>.<extension_id>)
59+
* @param {boolean} testCommerce - Parameter to test paid preview extension without making azure plans public
60+
* @param {boolean} isFreeOrTrialInstall - Parameter represents install or trial workflow (required for legacy install flows)
61+
* @param {boolean} isAccountOwner - Parameter represents whether user is owner or PCA of an account
62+
* @param {boolean} isLinked - Parameter represents whether account is linked with a subscription
63+
* @param {boolean} isConnectedServer - Parameter represents whether Buy operation should be evaluated
6264
* @param {boolean} isBuyOperationValid
6365
*/
6466
public async getAcquisitionOptions(

api/FileContainerApiBase.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,20 @@ export class FileContainerApiBase extends basem.ClientApiBase implements IFileCo
182182
}
183183

184184
/**
185-
* @param {number} containerId
186-
* @param {string} scope
187-
* @param {string} itemPath
188-
* @param {boolean} metadata
189-
* @param {string} format
190-
* @param {string} downloadFileName
185+
* Gets the specified file container object in a format dependent upon the given parameters or HTTP Accept request header
186+
*
187+
* @param {number} containerId - The requested container Id
188+
* @param {string} scope - A guid representing the scope of the container. This is often the project id.
189+
* @param {string} itemPath - The path to the item of interest
190+
* @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
191+
* @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.
192+
* @param {string} downloadFileName - If specified and returning other than JSON format, then this download name will be used (else defaults to itemPath)
191193
* @param {boolean} includeDownloadTickets
192-
* @param {boolean} isShallow
193-
* @param {boolean} ignoreRequestedMediaType
194+
* @param {boolean} isShallow - If true, returns only immediate children(files & folders) for the given itemPath. False will return all items recursively within itemPath.
195+
* @param {boolean} ignoreRequestedMediaType - Set to true to ignore the HTTP Accept request header. Default is false.
194196
* @param {boolean} includeBlobMetadata
195-
* @param {boolean} saveAbsolutePath
196-
* @param {boolean} preferRedirect
197+
* @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.
198+
* @param {boolean} preferRedirect - Set to true to get the redirect response which leads to the stream with content. Default is false.
197199
*/
198200
public async getItems(
199201
containerId: number,

api/GalleryApi.ts

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export interface IGalleryApi extends compatBase.GalleryCompatHttpClientBase {
7575
getPublisher(publisherName: string, flags?: number): Promise<GalleryInterfaces.Publisher>;
7676
updatePublisher(publisher: GalleryInterfaces.Publisher, publisherName: string): Promise<GalleryInterfaces.Publisher>;
7777
updatePublisherMembers(roleAssignments: GalleryInterfaces.PublisherUserRoleAssignmentRef[], publisherName: string, limitToCallerIdentityDomain?: boolean): Promise<GalleryInterfaces.PublisherRoleAssignment[]>;
78+
publishExtensionWithPublisherSignature(customHeaders: any, contentStream: NodeJS.ReadableStream, publisherName: string, extensionName: string, extensionType?: string, reCaptchaToken?: string, bypassScopeCheck?: boolean): Promise<GalleryInterfaces.PublishedExtension>;
7879
getPublisherWithoutToken(publisherName: string): Promise<GalleryInterfaces.Publisher>;
7980
getQuestions(publisherName: string, extensionName: string, count?: number, page?: number, afterDate?: Date): Promise<GalleryInterfaces.QuestionsResult>;
8081
reportQuestion(concern: GalleryInterfaces.Concern, pubName: string, extName: string, questionId: number): Promise<GalleryInterfaces.Concern>;
@@ -2159,7 +2160,9 @@ export class GalleryApi extends compatBase.GalleryCompatHttpClientBase implement
21592160
}
21602161

21612162
/**
2162-
* @param {GalleryInterfaces.AzureRestApiRequestModel} azureRestApiRequestModel
2163+
* 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
2164+
*
2165+
* @param {GalleryInterfaces.AzureRestApiRequestModel} azureRestApiRequestModel - All the parameters are sent in the request body
21632166
*/
21642167
public async extensionValidator(
21652168
azureRestApiRequestModel: GalleryInterfaces.AzureRestApiRequestModel
@@ -2826,6 +2829,68 @@ export class GalleryApi extends compatBase.GalleryCompatHttpClientBase implement
28262829
});
28272830
}
28282831

2832+
/**
2833+
* @param {NodeJS.ReadableStream} contentStream - Content to upload
2834+
* @param {string} publisherName
2835+
* @param {string} extensionName
2836+
* @param {string} extensionType
2837+
* @param {string} reCaptchaToken
2838+
* @param {boolean} bypassScopeCheck
2839+
*/
2840+
public async publishExtensionWithPublisherSignature(
2841+
customHeaders: any,
2842+
contentStream: NodeJS.ReadableStream,
2843+
publisherName: string,
2844+
extensionName: string,
2845+
extensionType?: string,
2846+
reCaptchaToken?: string,
2847+
bypassScopeCheck?: boolean
2848+
): Promise<GalleryInterfaces.PublishedExtension> {
2849+
2850+
return new Promise<GalleryInterfaces.PublishedExtension>(async (resolve, reject) => {
2851+
let routeValues: any = {
2852+
publisherName: publisherName,
2853+
extensionName: extensionName
2854+
};
2855+
2856+
let queryValues: any = {
2857+
extensionType: extensionType,
2858+
reCaptchaToken: reCaptchaToken,
2859+
bypassScopeCheck: bypassScopeCheck,
2860+
};
2861+
2862+
customHeaders = customHeaders || {};
2863+
customHeaders["Content-Type"] = "multipart/related";
2864+
2865+
try {
2866+
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
2867+
"7.2-preview.1",
2868+
"gallery",
2869+
"e11ea35a-16fe-4b80-ab11-c4cab88a0969",
2870+
routeValues,
2871+
queryValues);
2872+
2873+
let url: string = verData.requestUrl!;
2874+
2875+
let options: restm.IRequestOptions = this.createRequestOptions('application/json',
2876+
verData.apiVersion);
2877+
options.additionalHeaders = customHeaders;
2878+
2879+
let res: restm.IRestResponse<GalleryInterfaces.PublishedExtension>;
2880+
res = await this.rest.uploadStream<GalleryInterfaces.PublishedExtension>("PUT", url, contentStream, options);
2881+
2882+
let ret = this.formatResponse(res.result,
2883+
GalleryInterfaces.TypeInfo.PublishedExtension,
2884+
false);
2885+
2886+
resolve(ret);
2887+
}
2888+
catch (err) {
2889+
reject(err);
2890+
}
2891+
});
2892+
}
2893+
28292894
/**
28302895
* @param {string} publisherName
28312896
*/

api/GitApi.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,8 +1206,10 @@ export class GitApi extends basem.ClientApiBase implements IGitApi {
12061206
}
12071207

12081208
/**
1209-
* @param {GitInterfaces.GitQueryBranchStatsCriteria} searchCriteria
1210-
* @param {string} repositoryId
1209+
* Retrieve statistics for multiple commits
1210+
*
1211+
* @param {GitInterfaces.GitQueryBranchStatsCriteria} searchCriteria - Base Commit and List of Target Commits to compare.
1212+
* @param {string} repositoryId - The name or ID of the repository.
12111213
* @param {string} project - Project ID or project name
12121214
*/
12131215
public async getBranchStatsBatch(

api/ManagementApi.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export class ManagementApi extends basem.ClientApiBase implements IManagementApi
4242
}
4343

4444
/**
45+
* Delete the billing info for an organization.
46+
*
4547
* @param {string} organizationId
4648
*/
4749
public async deleteBillingInfo(
@@ -82,6 +84,8 @@ export class ManagementApi extends basem.ClientApiBase implements IManagementApi
8284
}
8385

8486
/**
87+
* Delete the meter usage history from Primary SU for an organization.
88+
*
8589
* @param {string} organizationId
8690
*/
8791
public async deleteMeterUsageHistory(
@@ -164,6 +168,8 @@ export class ManagementApi extends basem.ClientApiBase implements IManagementApi
164168
}
165169

166170
/**
171+
* Save the billing info for an organization.
172+
*
167173
* @param {ManagementInterfaces.BillingInfo} billingInfo
168174
* @param {string} organizationId
169175
*/

api/ReleaseApi.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,22 +1220,24 @@ export class ReleaseApi extends basem.ClientApiBase implements IReleaseApi {
12201220
}
12211221

12221222
/**
1223+
* Get a list of deployments
1224+
*
12231225
* @param {string} project - Project ID or project name
1224-
* @param {number} definitionId
1225-
* @param {number} definitionEnvironmentId
1226-
* @param {string} createdBy
1227-
* @param {Date} minModifiedTime
1228-
* @param {Date} maxModifiedTime
1229-
* @param {ReleaseInterfaces.DeploymentStatus} deploymentStatus
1230-
* @param {ReleaseInterfaces.DeploymentOperationStatus} operationStatus
1231-
* @param {boolean} latestAttemptsOnly
1232-
* @param {ReleaseInterfaces.ReleaseQueryOrder} queryOrder
1233-
* @param {number} top
1234-
* @param {number} continuationToken
1235-
* @param {string} createdFor
1236-
* @param {Date} minStartedTime
1237-
* @param {Date} maxStartedTime
1238-
* @param {string} sourceBranch
1226+
* @param {number} definitionId - List the deployments for a given definition id.
1227+
* @param {number} definitionEnvironmentId - List the deployments for a given definition environment id.
1228+
* @param {string} createdBy - List the deployments for which deployments are created as identity specified.
1229+
* @param {Date} minModifiedTime - List the deployments with LastModified time >= minModifiedTime.
1230+
* @param {Date} maxModifiedTime - List the deployments with LastModified time <= maxModifiedTime.
1231+
* @param {ReleaseInterfaces.DeploymentStatus} deploymentStatus - List the deployments with given deployment status. Defult is 'All'.
1232+
* @param {ReleaseInterfaces.DeploymentOperationStatus} operationStatus - List the deployments with given operation status. Default is 'All'.
1233+
* @param {boolean} latestAttemptsOnly - 'true' to include deployments with latest attempt only. Default is 'false'.
1234+
* @param {ReleaseInterfaces.ReleaseQueryOrder} queryOrder - List the deployments with given query order. Default is 'Descending'.
1235+
* @param {number} top - List the deployments with given top. Default top is '50' and Max top is '100'.
1236+
* @param {number} continuationToken - List the deployments with deployment id >= continuationToken.
1237+
* @param {string} createdFor - List the deployments for which deployments are requested as identity specified.
1238+
* @param {Date} minStartedTime - List the deployments with StartedOn time >= minStartedTime.
1239+
* @param {Date} maxStartedTime - List the deployments with StartedOn time <= maxStartedTime.
1240+
* @param {string} sourceBranch - List the deployments that are deployed from given branch name.
12391241
*/
12401242
public async getDeployments(
12411243
project: string,

0 commit comments

Comments
 (0)