import { IVssRestClientOptions } from "../Common/Context"; import { RestClientBase } from "../Common/RestClientBase"; import * as Gallery from "../Gallery/Gallery"; export declare class GalleryRestClient extends RestClientBase { constructor(options: IVssRestClientOptions); static readonly RESOURCE_AREA_ID: string; /** * @param extensionId - * @param accountName - */ shareExtensionById(extensionId: string, accountName: string): Promise; /** * @param extensionId - * @param accountName - */ unshareExtensionById(extensionId: string, accountName: string): Promise; /** * @param publisherName - * @param extensionName - * @param accountName - */ shareExtension(publisherName: string, extensionName: string, accountName: string): Promise; /** * @param publisherName - * @param extensionName - * @param accountName - */ unshareExtension(publisherName: string, extensionName: string, accountName: string): Promise; /** * @param itemId - * @param installationTarget - * @param testCommerce - * @param isFreeOrTrialInstall - */ getAcquisitionOptions(itemId: string, installationTarget: string, testCommerce?: boolean, isFreeOrTrialInstall?: boolean): Promise; /** * @param acquisitionRequest - */ requestAcquisition(acquisitionRequest: Gallery.ExtensionAcquisitionRequest): Promise; /** * @param publisherName - * @param extensionName - * @param version - * @param assetType - * @param accountToken - * @param acceptDefault - * @param accountTokenHeader - Header to pass the account token */ getAssetByName(publisherName: string, extensionName: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean, accountTokenHeader?: String): Promise; /** * @param extensionId - * @param version - * @param assetType - * @param accountToken - * @param acceptDefault - * @param accountTokenHeader - Header to pass the account token */ getAsset(extensionId: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean, accountTokenHeader?: String): Promise; /** * @param publisherName - * @param extensionName - * @param version - * @param assetType - * @param accountToken - * @param accountTokenHeader - Header to pass the account token */ getAssetAuthenticated(publisherName: string, extensionName: string, version: string, assetType: string, accountToken?: string, accountTokenHeader?: String): Promise; /** * @param publisherName - * @param azurePublisherId - */ associateAzurePublisher(publisherName: string, azurePublisherId: string): Promise; /** * @param publisherName - */ queryAssociatedAzurePublisher(publisherName: string): Promise; /** * @param languages - */ getCategories(languages?: string): Promise; /** * @param categoryName - * @param languages - * @param product - */ getCategoryDetails(categoryName: string, languages?: string, product?: string): Promise; /** * @param product - * @param categoryId - * @param lcid - * @param source - * @param productVersion - * @param skus - * @param subSkus - * @param productArchitecture - */ getCategoryTree(product: string, categoryId: string, lcid?: number, source?: string, productVersion?: string, skus?: string, subSkus?: string, productArchitecture?: string): Promise; /** * @param product - * @param lcid - * @param source - * @param productVersion - * @param skus - * @param subSkus - */ getRootCategories(product: string, lcid?: number, source?: string, productVersion?: string, skus?: string, subSkus?: string): Promise; /** * @param publisherName - * @param extensionName - * @param version - */ getCertificate(publisherName: string, extensionName: string, version?: string): Promise; /** * @param customerSupportRequest - */ createSupportRequest(customerSupportRequest: Gallery.CustomerSupportRequest): Promise; /** * @param publisherName - * @param extensionName - */ createDraftForEditExtension(publisherName: string, extensionName: string): Promise; /** * @param draftPatch - * @param publisherName - * @param extensionName - * @param draftId - */ performEditExtensionDraftOperation(draftPatch: Gallery.ExtensionDraftPatch, publisherName: string, extensionName: string, draftId: string): Promise; /** * @param content - Content to upload * @param publisherName - * @param extensionName - * @param draftId - * @param fileName - Header to pass the filename of the uploaded data */ updatePayloadInDraftForEditExtension(content: any, publisherName: string, extensionName: string, draftId: string, fileName?: String): Promise; /** * @param content - Content to upload * @param publisherName - * @param extensionName - * @param draftId - * @param assetType - */ addAssetForEditExtensionDraft(content: string, publisherName: string, extensionName: string, draftId: string, assetType: string): Promise; /** * @param content - Content to upload * @param publisherName - * @param product - Header to pass the product type of the payload file * @param fileName - Header to pass the filename of the uploaded data */ createDraftForNewExtension(content: any, publisherName: string, product: String, fileName?: String): Promise; /** * @param draftPatch - * @param publisherName - * @param draftId - */ performNewExtensionDraftOperation(draftPatch: Gallery.ExtensionDraftPatch, publisherName: string, draftId: string): Promise; /** * @param content - Content to upload * @param publisherName - * @param draftId - * @param fileName - Header to pass the filename of the uploaded data */ updatePayloadInDraftForNewExtension(content: any, publisherName: string, draftId: string, fileName?: String): Promise; /** * @param content - Content to upload * @param publisherName - * @param draftId - * @param assetType - */ addAssetForNewExtensionDraft(content: string, publisherName: string, draftId: string, assetType: string): Promise; /** * @param publisherName - * @param draftId - * @param assetType - * @param extensionName - */ getAssetFromEditExtensionDraft(publisherName: string, draftId: string, assetType: string, extensionName: string): Promise; /** * @param publisherName - * @param draftId - * @param assetType - */ getAssetFromNewExtensionDraft(publisherName: string, draftId: string, assetType: string): Promise; /** * Get install/uninstall events of an extension. If both count and afterDate parameters are specified, count takes precedence. * * @param publisherName - Name of the publisher * @param extensionName - Name of the extension * @param count - Count of events to fetch, applies to each event type. * @param afterDate - Fetch events that occurred on or after this date * @param include - Filter options. Supported values: install, uninstall, review, acquisition, sales. Default is to fetch all types of events * @param includeProperty - Event properties to include. Currently only 'lastContactDetails' is supported for uninstall events */ getExtensionEvents(publisherName: string, extensionName: string, count?: number, afterDate?: Date, include?: string, includeProperty?: string): Promise; /** * API endpoint to publish extension install/uninstall events. This is meant to be invoked by EMS only for sending us data related to install/uninstall of an extension. * * @param extensionEvents - */ publishExtensionEvents(extensionEvents: Gallery.ExtensionEvents[]): Promise; /** * @param extensionQuery - * @param accountToken - * @param accountTokenHeader - Header to pass the account token */ queryExtensions(extensionQuery: Gallery.ExtensionQuery, accountToken?: string, accountTokenHeader?: String): Promise; /** * @param content - Content to upload * @param extensionType - * @param reCaptchaToken - */ createExtension(content: any, extensionType?: string, reCaptchaToken?: string): Promise; /** * @param extensionId - * @param version - */ deleteExtensionById(extensionId: string, version?: string): Promise; /** * @param extensionId - * @param version - * @param flags - */ getExtensionById(extensionId: string, version?: string, flags?: Gallery.ExtensionQueryFlags): Promise; /** * @param extensionId - * @param reCaptchaToken - */ updateExtensionById(extensionId: string, reCaptchaToken?: string): Promise; /** * @param content - Content to upload * @param publisherName - * @param extensionType - * @param reCaptchaToken - */ createExtensionWithPublisher(content: any, publisherName: string, extensionType?: string, reCaptchaToken?: string): Promise; /** * @param publisherName - * @param extensionName - * @param version - */ deleteExtension(publisherName: string, extensionName: string, version?: string): Promise; /** * @param publisherName - * @param extensionName - * @param version - * @param flags - * @param accountToken - * @param accountTokenHeader - Header to pass the account token */ getExtension(publisherName: string, extensionName: string, version?: string, flags?: Gallery.ExtensionQueryFlags, accountToken?: string, accountTokenHeader?: String): Promise; /** * REST endpoint to update an extension. * * @param content - Content to upload * @param publisherName - Name of the publisher * @param extensionName - Name of the extension * @param extensionType - * @param reCaptchaToken - * @param bypassScopeCheck - This parameter decides if the scope change check needs to be invoked or not */ updateExtension(content: any, publisherName: string, extensionName: string, extensionType?: string, reCaptchaToken?: string, bypassScopeCheck?: boolean): Promise; /** * @param publisherName - * @param extensionName - * @param flags - */ updateExtensionProperties(publisherName: string, extensionName: string, flags: Gallery.PublishedExtensionFlags): Promise; /** * @param publisherName - * @param extensionName - * @param hostType - * @param hostName - */ shareExtensionWithHost(publisherName: string, extensionName: string, hostType: string, hostName: string): Promise; /** * @param publisherName - * @param extensionName - * @param hostType - * @param hostName - */ unshareExtensionWithHost(publisherName: string, extensionName: string, hostType: string, hostName: string): Promise; /** * 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 azureRestApiRequestModel - All the parameters are sent in the request body */ extensionValidator(azureRestApiRequestModel: Gallery.AzureRestApiRequestModel): Promise; /** * Send Notification * * @param notificationData - Denoting the data needed to send notification */ sendNotifications(notificationData: Gallery.NotificationsData): Promise; /** * This endpoint gets hit when you download a VSTS extension from the Web UI * * @param publisherName - * @param extensionName - * @param version - * @param accountToken - * @param acceptDefault - * @param accountTokenHeader - Header to pass the account token */ getPackage(publisherName: string, extensionName: string, version: string, accountToken?: string, acceptDefault?: boolean, accountTokenHeader?: String): Promise; /** * @param publisherName - * @param extensionName - * @param version - * @param assetType - * @param assetToken - * @param accountToken - * @param acceptDefault - * @param accountTokenHeader - Header to pass the account token */ getAssetWithToken(publisherName: string, extensionName: string, version: string, assetType: string, assetToken?: string, accountToken?: string, acceptDefault?: boolean, accountTokenHeader?: String): Promise; /** * Delete publisher asset like logo * * @param publisherName - Internal name of the publisher * @param assetType - Type of asset. Default value is 'logo'. */ deletePublisherAsset(publisherName: string, assetType?: string): Promise; /** * Get publisher asset like logo as a stream * * @param publisherName - Internal name of the publisher * @param assetType - Type of asset. Default value is 'logo'. */ getPublisherAsset(publisherName: string, assetType?: string): Promise; /** * Update publisher asset like logo. It accepts asset file as an octet stream and file name is passed in header values. * * @param content - Content to upload * @param publisherName - Internal name of the publisher * @param assetType - Type of asset. Default value is 'logo'. * @param fileName - Header to pass the filename of the uploaded data */ updatePublisherAsset(content: any, publisherName: string, assetType?: string, fileName?: String): Promise<{ [key: string]: string; }>; /** * @param publisherName - */ fetchDomainToken(publisherName: string): Promise; /** * @param publisherName - */ verifyDomainToken(publisherName: string): Promise; /** * @param publisherQuery - */ queryPublishers(publisherQuery: Gallery.PublisherQuery): Promise; /** * @param publisher - */ createPublisher(publisher: Gallery.Publisher): Promise; /** * @param publisherName - */ deletePublisher(publisherName: string): Promise; /** * @param publisherName - * @param flags - */ getPublisher(publisherName: string, flags?: number): Promise; /** * @param publisher - * @param publisherName - */ updatePublisher(publisher: Gallery.Publisher, publisherName: string): Promise; /** * Endpoint to add/modify publisher membership. Currently Supports only addition/modification of 1 user at a time Works only for adding members of same tenant. * * @param roleAssignments - List of user identifiers(email address) and role to be added. Currently only one entry is supported. * @param publisherName - The name/id of publisher to which users have to be added * @param limitToCallerIdentityDomain - Should cross tenant addtions be allowed or not. */ updatePublisherMembers(roleAssignments: Gallery.PublisherUserRoleAssignmentRef[], publisherName: string, limitToCallerIdentityDomain?: boolean): Promise; /** * @param content - Content to upload * @param publisherName - * @param extensionName - * @param extensionType - * @param reCaptchaToken - * @param bypassScopeCheck - */ publishExtensionWithPublisherSignature(content: any, publisherName: string, extensionName: string, extensionType?: string, reCaptchaToken?: string, bypassScopeCheck?: boolean): Promise; /** * @param publisherName - */ getPublisherWithoutToken(publisherName: string): Promise; /** * Returns a list of questions with their responses associated with an extension. * * @param publisherName - Name of the publisher who published the extension. * @param extensionName - Name of the extension. * @param count - Number of questions to retrieve (defaults to 10). * @param page - Page number from which set of questions are to be retrieved. * @param afterDate - If provided, results questions are returned which were posted after this date */ getQuestions(publisherName: string, extensionName: string, count?: number, page?: number, afterDate?: Date): Promise; /** * Flags a concern with an existing question for an extension. * * @param concern - User reported concern with a question for the extension. * @param pubName - Name of the publisher who published the extension. * @param extName - Name of the extension. * @param questionId - Identifier of the question to be updated for the extension. */ reportQuestion(concern: Gallery.Concern, pubName: string, extName: string, questionId: number): Promise; /** * Creates a new question for an extension. * * @param question - Question to be created for the extension. * @param publisherName - Name of the publisher who published the extension. * @param extensionName - Name of the extension. */ createQuestion(question: Gallery.Question, publisherName: string, extensionName: string): Promise; /** * Deletes an existing question and all its associated responses for an extension. (soft delete) * * @param publisherName - Name of the publisher who published the extension. * @param extensionName - Name of the extension. * @param questionId - Identifier of the question to be deleted for the extension. */ deleteQuestion(publisherName: string, extensionName: string, questionId: number): Promise; /** * Updates an existing question for an extension. * * @param question - Updated question to be set for the extension. * @param publisherName - Name of the publisher who published the extension. * @param extensionName - Name of the extension. * @param questionId - Identifier of the question to be updated for the extension. */ updateQuestion(question: Gallery.Question, publisherName: string, extensionName: string, questionId: number): Promise; /** * Creates a new response for a given question for an extension. * * @param response - Response to be created for the extension. * @param publisherName - Name of the publisher who published the extension. * @param extensionName - Name of the extension. * @param questionId - Identifier of the question for which response is to be created for the extension. */ createResponse(response: Gallery.Response, publisherName: string, extensionName: string, questionId: number): Promise; /** * Deletes a response for an extension. (soft delete) * * @param publisherName - Name of the publisher who published the extension. * @param extensionName - Name of the extension. * @param questionId - Identifies the question whose response is to be deleted. * @param responseId - Identifies the response to be deleted. */ deleteResponse(publisherName: string, extensionName: string, questionId: number, responseId: number): Promise; /** * Updates an existing response for a given question for an extension. * * @param response - Updated response to be set for the extension. * @param publisherName - Name of the publisher who published the extension. * @param extensionName - Name of the extension. * @param questionId - Identifier of the question for which response is to be updated for the extension. * @param responseId - Identifier of the response which has to be updated. */ updateResponse(response: Gallery.Response, publisherName: string, extensionName: string, questionId: number, responseId: number): Promise; /** * Returns extension reports * * @param publisherName - Name of the publisher who published the extension * @param extensionName - Name of the extension * @param days - Last n days report. If afterDate and days are specified, days will take priority * @param count - Number of events to be returned * @param afterDate - Use if you want to fetch events newer than the specified date */ getExtensionReports(publisherName: string, extensionName: string, days?: number, count?: number, afterDate?: Date): Promise; /** * Returns a list of reviews associated with an extension * * @param publisherName - Name of the publisher who published the extension * @param extensionName - Name of the extension * @param count - Number of reviews to retrieve (defaults to 5) * @param filterOptions - FilterOptions to filter out empty reviews etcetera, defaults to none * @param beforeDate - Use if you want to fetch reviews older than the specified date, defaults to null * @param afterDate - Use if you want to fetch reviews newer than the specified date, defaults to null */ getReviews(publisherName: string, extensionName: string, count?: number, filterOptions?: Gallery.ReviewFilterOptions, beforeDate?: Date, afterDate?: Date): Promise; /** * Returns a summary of the reviews * * @param pubName - Name of the publisher who published the extension * @param extName - Name of the extension * @param beforeDate - Use if you want to fetch summary of reviews older than the specified date, defaults to null * @param afterDate - Use if you want to fetch summary of reviews newer than the specified date, defaults to null */ getReviewsSummary(pubName: string, extName: string, beforeDate?: Date, afterDate?: Date): Promise; /** * Creates a new review for an extension * * @param review - Review to be created for the extension * @param pubName - Name of the publisher who published the extension * @param extName - Name of the extension */ createReview(review: Gallery.Review, pubName: string, extName: string): Promise; /** * Deletes a review * * @param pubName - Name of the publisher who published the extension * @param extName - Name of the extension * @param reviewId - Id of the review which needs to be updated */ deleteReview(pubName: string, extName: string, reviewId: number): Promise; /** * Updates or Flags a review * * @param reviewPatch - ReviewPatch object which contains the changes to be applied to the review * @param pubName - Name of the publisher who published the extension * @param extName - Name of the extension * @param reviewId - Id of the review which needs to be updated */ updateReview(reviewPatch: Gallery.ReviewPatch, pubName: string, extName: string, reviewId: number): Promise; /** * @param category - */ createCategory(category: Gallery.ExtensionCategory): Promise; /** * Get all setting entries for the given user/all-users scope * * @param userScope - User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. * @param key - Optional key under which to filter all the entries */ getGalleryUserSettings(userScope: string, key?: string): Promise<{ [key: string]: any; }>; /** * Set all setting entries for the given user/all-users scope * * @param entries - A key-value pair of all settings that need to be set * @param userScope - User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. */ setGalleryUserSettings(entries: { [key: string]: any; }, userScope: string): Promise; /** * @param keyType - * @param expireCurrentSeconds - */ generateKey(keyType: string, expireCurrentSeconds?: number): Promise; /** * @param keyType - */ getSigningKey(keyType: string): Promise; /** * @param extensionStatisticsUpdate - * @param publisherName - * @param extensionName - */ updateExtensionStatistics(extensionStatisticsUpdate: Gallery.ExtensionStatisticUpdate, publisherName: string, extensionName: string): Promise; /** * @param publisherName - * @param extensionName - * @param days - * @param aggregate - * @param afterDate - */ getExtensionDailyStats(publisherName: string, extensionName: string, days?: number, aggregate?: Gallery.ExtensionStatsAggregateType, afterDate?: Date): Promise; /** * This route/location id only supports HTTP POST anonymously, so that the page view daily stat can be incremented from Marketplace client. Trying to call GET on this route should result in an exception. Without this explicit implementation, calling GET on this public route invokes the above GET implementation GetExtensionDailyStats. * * @param publisherName - Name of the publisher * @param extensionName - Name of the extension * @param version - Version of the extension */ getExtensionDailyStatsAnonymous(publisherName: string, extensionName: string, version: string): Promise; /** * Increments a daily statistic associated with the extension * * @param publisherName - Name of the publisher * @param extensionName - Name of the extension * @param version - Version of the extension * @param statType - Type of stat to increment * @param targetPlatform - */ incrementExtensionDailyStat(publisherName: string, extensionName: string, version: string, statType: string, targetPlatform?: string): Promise; /** * @param publisherName - * @param extensionName - * @param version - * @param targetPlatform - */ getVerificationLog(publisherName: string, extensionName: string, version: string, targetPlatform?: string): Promise; /** * Endpoint to get the latest version(s) of a VS Code extension. * * @param publisherName - The name of the publisher of the requested VS Code extension. * @param extensionName - The extension name. */ getVSCodeExtensionLatestVersion(publisherName: string, extensionName: string): Promise; /** * @param itemName - * @param version - * @param statType - */ updateVSCodeWebExtensionStatistics(itemName: string, version: string, statType: Gallery.VSCodeWebExtensionStatisicsType): Promise; }