Родитель
be95c4d99f
Коммит
d0f7afc849
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,191 @@
|
|||
/*
|
||||
* ---------------------------------------------------------
|
||||
* Copyright(C) Microsoft Corporation. All rights reserved.
|
||||
* ---------------------------------------------------------
|
||||
*
|
||||
* ---------------------------------------------------------
|
||||
* Generated file, DO NOT EDIT
|
||||
* ---------------------------------------------------------
|
||||
*/
|
||||
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
import * as restm from 'typed-rest-client/RestClient';
|
||||
import * as httpm from 'typed-rest-client/HttpClient';
|
||||
import vsom = require('./VsoClient');
|
||||
import basem = require('./ClientApiBases');
|
||||
import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
|
||||
import GalleryInterfaces = require("./interfaces/GalleryInterfaces");
|
||||
|
||||
export interface IGalleryCompatHttpClientBase extends basem.ClientApiBase {
|
||||
createExtensionJson(extensionPackage: GalleryInterfaces.ExtensionPackage): Promise<GalleryInterfaces.PublishedExtension>;
|
||||
updateExtensionByIdJson(extensionPackage: GalleryInterfaces.ExtensionPackage, extensionId: string): Promise<GalleryInterfaces.PublishedExtension>;
|
||||
createExtensionWithPublisherJson(extensionPackage: GalleryInterfaces.ExtensionPackage, publisherName: string): Promise<GalleryInterfaces.PublishedExtension>;
|
||||
updateExtensionJson(extensionPackage: GalleryInterfaces.ExtensionPackage, publisherName: string, extensionName: string): Promise<GalleryInterfaces.PublishedExtension>;
|
||||
}
|
||||
|
||||
export class GalleryCompatHttpClientBase extends basem.ClientApiBase implements IGalleryCompatHttpClientBase {
|
||||
constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], userAgent?: string, options?: VsoBaseInterfaces.IRequestOptions) {
|
||||
super(baseUrl, handlers, userAgent, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {GalleryInterfaces.ExtensionPackage} extensionPackage
|
||||
*/
|
||||
public createExtensionJson(
|
||||
extensionPackage: GalleryInterfaces.ExtensionPackage
|
||||
): Promise<GalleryInterfaces.PublishedExtension> {
|
||||
|
||||
return new Promise<GalleryInterfaces.PublishedExtension>(async (resolve, reject) => {
|
||||
let routeValues: any = {
|
||||
};
|
||||
|
||||
try {
|
||||
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
|
||||
"3.1-preview.1",
|
||||
"gallery",
|
||||
"a41192c8-9525-4b58-bc86-179fa549d80d",
|
||||
routeValues);
|
||||
|
||||
let url: string = verData.requestUrl;
|
||||
let options: restm.IRequestOptions = this.createRequestOptions('application/json',
|
||||
verData.apiVersion);
|
||||
let res: restm.IRestResponse<GalleryInterfaces.PublishedExtension>;
|
||||
res = await this.rest.create<GalleryInterfaces.PublishedExtension>(url, extensionPackage, options);
|
||||
|
||||
let ret = this.formatResponse(res.result,
|
||||
GalleryInterfaces.TypeInfo.PublishedExtension,
|
||||
false);
|
||||
|
||||
resolve(ret);
|
||||
|
||||
}
|
||||
catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {GalleryInterfaces.ExtensionPackage} extensionPackage
|
||||
* @param {string} extensionId
|
||||
*/
|
||||
public updateExtensionByIdJson(
|
||||
extensionPackage: GalleryInterfaces.ExtensionPackage,
|
||||
extensionId: string
|
||||
): Promise<GalleryInterfaces.PublishedExtension> {
|
||||
|
||||
return new Promise<GalleryInterfaces.PublishedExtension>(async (resolve, reject) => {
|
||||
let routeValues: any = {
|
||||
extensionId: extensionId
|
||||
};
|
||||
|
||||
try {
|
||||
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
|
||||
"3.1-preview.1",
|
||||
"gallery",
|
||||
"a41192c8-9525-4b58-bc86-179fa549d80d",
|
||||
routeValues);
|
||||
|
||||
let url: string = verData.requestUrl;
|
||||
let options: restm.IRequestOptions = this.createRequestOptions('application/json',
|
||||
verData.apiVersion);
|
||||
let res: restm.IRestResponse<GalleryInterfaces.PublishedExtension>;
|
||||
res = await this.rest.replace<GalleryInterfaces.PublishedExtension>(url, extensionPackage, options);
|
||||
|
||||
let ret = this.formatResponse(res.result,
|
||||
GalleryInterfaces.TypeInfo.PublishedExtension,
|
||||
false);
|
||||
|
||||
resolve(ret);
|
||||
|
||||
}
|
||||
catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {GalleryInterfaces.ExtensionPackage} extensionPackage
|
||||
* @param {string} publisherName
|
||||
*/
|
||||
public createExtensionWithPublisherJson(
|
||||
extensionPackage: GalleryInterfaces.ExtensionPackage,
|
||||
publisherName: string
|
||||
): Promise<GalleryInterfaces.PublishedExtension> {
|
||||
|
||||
return new Promise<GalleryInterfaces.PublishedExtension>(async (resolve, reject) => {
|
||||
let routeValues: any = {
|
||||
publisherName: publisherName
|
||||
};
|
||||
|
||||
try {
|
||||
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
|
||||
"3.1-preview.1",
|
||||
"gallery",
|
||||
"e11ea35a-16fe-4b80-ab11-c4cab88a0966",
|
||||
routeValues);
|
||||
|
||||
let url: string = verData.requestUrl;
|
||||
let options: restm.IRequestOptions = this.createRequestOptions('application/json',
|
||||
verData.apiVersion);
|
||||
let res: restm.IRestResponse<GalleryInterfaces.PublishedExtension>;
|
||||
res = await this.rest.create<GalleryInterfaces.PublishedExtension>(url, extensionPackage, options);
|
||||
|
||||
let ret = this.formatResponse(res.result,
|
||||
GalleryInterfaces.TypeInfo.PublishedExtension,
|
||||
false);
|
||||
|
||||
resolve(ret);
|
||||
|
||||
}
|
||||
catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {GalleryInterfaces.ExtensionPackage} extensionPackage
|
||||
* @param {string} publisherName
|
||||
* @param {string} extensionName
|
||||
*/
|
||||
public updateExtensionJson(
|
||||
extensionPackage: GalleryInterfaces.ExtensionPackage,
|
||||
publisherName: string,
|
||||
extensionName: string
|
||||
): Promise<GalleryInterfaces.PublishedExtension> {
|
||||
|
||||
return new Promise<GalleryInterfaces.PublishedExtension>(async (resolve, reject) => {
|
||||
let routeValues: any = {
|
||||
publisherName: publisherName,
|
||||
extensionName: extensionName
|
||||
};
|
||||
|
||||
try {
|
||||
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
|
||||
"3.1-preview.1",
|
||||
"gallery",
|
||||
"e11ea35a-16fe-4b80-ab11-c4cab88a0966",
|
||||
routeValues);
|
||||
|
||||
let url: string = verData.requestUrl;
|
||||
let options: restm.IRequestOptions = this.createRequestOptions('application/json',
|
||||
verData.apiVersion);
|
||||
let res: restm.IRestResponse<GalleryInterfaces.PublishedExtension>;
|
||||
res = await this.rest.replace<GalleryInterfaces.PublishedExtension>(url, extensionPackage, options);
|
||||
|
||||
let ret = this.formatResponse(res.result,
|
||||
GalleryInterfaces.TypeInfo.PublishedExtension,
|
||||
false);
|
||||
|
||||
resolve(ret);
|
||||
|
||||
}
|
||||
catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@ import dashboardm = require('./DashboardApi');
|
|||
import extmgmtm = require("./ExtensionManagementApi");
|
||||
import featuremgmtm = require("./FeatureManagementApi");
|
||||
import filecontainerm = require('./FileContainerApi');
|
||||
import gallerym = require('./GalleryApi');
|
||||
import gitm = require('./GitApi');
|
||||
import locationsm = require('./LocationsApi');
|
||||
import notificationm = require('./NotificationApi');
|
||||
|
@ -218,6 +219,12 @@ export class WebApi {
|
|||
return new filecontainerm.FileContainerApi(serverUrl, handlers, this.options);
|
||||
}
|
||||
|
||||
public async getGalleryApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<gallerym.IGalleryApi> {
|
||||
serverUrl = await this._getResourceAreaUrl(serverUrl || this.serverUrl, gallerym.GalleryApi.RESOURCE_AREA_ID);
|
||||
handlers = handlers || [this.authHandler];
|
||||
return new gallerym.GalleryApi(serverUrl, handlers, this.options);
|
||||
}
|
||||
|
||||
public async getGitApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): Promise<gitm.IGitApi> {
|
||||
serverUrl = await this._getResourceAreaUrl(serverUrl || this.serverUrl, gitm.GitApi.RESOURCE_AREA_ID);
|
||||
handlers = handlers || [this.authHandler];
|
||||
|
|
|
@ -1235,6 +1235,29 @@ export enum PublisherState {
|
|||
CertificationRevoked = 8,
|
||||
}
|
||||
|
||||
export enum PublisherState {
|
||||
/**
|
||||
* No state exists for this publisher.
|
||||
*/
|
||||
None = 0,
|
||||
/**
|
||||
* This state indicates that publisher has applied for Marketplace verification (via UI) and still not been certified. This state would be reset once the publisher is verified.
|
||||
*/
|
||||
VerificationPending = 1,
|
||||
/**
|
||||
* This state indicates that publisher has applied for Marketplace certification (via UI) and still not been certified. This state would be reset once the publisher is certified.
|
||||
*/
|
||||
CertificationPending = 2,
|
||||
/**
|
||||
* This state indicates that publisher had applied for Marketplace certification (via UI) but his/her certification got rejected. This state would be reset if and when the publisher is certified.
|
||||
*/
|
||||
CertificationRejected = 4,
|
||||
/**
|
||||
* This state indicates that publisher was certified on the Marketplace, but his/her certification got revoked. This state would never be reset, even after publisher gets re-certified. It would indicate that the publisher certification was revoked at least once.
|
||||
*/
|
||||
CertificationRevoked = 8,
|
||||
}
|
||||
|
||||
/**
|
||||
* The core structure of a QnA item
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "azure-devops-node-api",
|
||||
"description": "Node client for Azure DevOps and TFS REST APIs",
|
||||
"version": "7.0.0",
|
||||
"version": "7.1.0",
|
||||
"main": "./WebApi.js",
|
||||
"types": "./WebApi.d.ts",
|
||||
"scripts": {
|
||||
|
|
|
@ -35,7 +35,7 @@ export async function run() {
|
|||
try
|
||||
{
|
||||
const vstsCollectionLevel: vsoNodeApi.WebApi = await common.getWebApi();
|
||||
|
||||
|
||||
/********** Build **********/
|
||||
printSectionStart("Build");
|
||||
const buildApi = await vstsCollectionLevel.getBuildApi();
|
||||
|
@ -90,6 +90,15 @@ export async function run() {
|
|||
console.log(`found ${containers.length} containers`);
|
||||
}
|
||||
|
||||
/********** Gallery **********/
|
||||
printSectionStart('Gallery - Deployment Level');
|
||||
const galleryApi = await vstsCollectionLevel.getGalleryApi();
|
||||
const categories: string[] = await galleryApi.getCategories();
|
||||
|
||||
if (categories) {
|
||||
console.log(`found ${categories.length} categories`);
|
||||
}
|
||||
|
||||
/********** Git **********/
|
||||
printSectionStart("Git");
|
||||
const gitApi = await vstsCollectionLevel.getGitApi();
|
||||
|
|
Загрузка…
Ссылка в новой задаче