/// import basem = require('./ClientApiBases'); import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces'); import Comments_Contracts = require("./interfaces/CommentsInterfaces"); import GitInterfaces = require("./interfaces/GitInterfaces"); import VSSInterfaces = require("./interfaces/common/VSSInterfaces"); import WikiInterfaces = require("./interfaces/WikiInterfaces"); export interface IWikiApi extends basem.ClientApiBase { createCommentAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, project: string, wikiIdentifier: string, pageId: number): Promise; getAttachmentContent(project: string, wikiIdentifier: string, pageId: number, attachmentId: string): Promise; addCommentReaction(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType): Promise; deleteCommentReaction(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType): Promise; getEngagedUsers(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType, top?: number, skip?: number): Promise; addComment(request: Comments_Contracts.CommentCreateParameters, project: string, wikiIdentifier: string, pageId: number): Promise; deleteComment(project: string, wikiIdentifier: string, pageId: number, id: number): Promise; getComment(project: string, wikiIdentifier: string, pageId: number, id: number, excludeDeleted?: boolean, expand?: Comments_Contracts.CommentExpandOptions): Promise; listComments(project: string, wikiIdentifier: string, pageId: number, top?: number, continuationToken?: string, excludeDeleted?: boolean, expand?: Comments_Contracts.CommentExpandOptions, order?: Comments_Contracts.CommentSortOrder, parentId?: number): Promise; updateComment(comment: Comments_Contracts.CommentUpdateParameters, project: string, wikiIdentifier: string, pageId: number, id: number): Promise; getPageText(project: string, wikiIdentifier: string, path?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean): Promise; getPageZip(project: string, wikiIdentifier: string, path?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean): Promise; getPageByIdText(project: string, wikiIdentifier: string, id: number, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContent?: boolean): Promise; getPageByIdZip(project: string, wikiIdentifier: string, id: number, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContent?: boolean): Promise; getPagesBatch(pagesBatchRequest: WikiInterfaces.WikiPagesBatchRequest, project: string, wikiIdentifier: string, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Promise; getPageData(project: string, wikiIdentifier: string, pageId: number, pageViewsForDays?: number): Promise; createOrUpdatePageViewStats(project: string, wikiIdentifier: string, wikiVersion: GitInterfaces.GitVersionDescriptor, path: string, oldPath?: string): Promise; createWiki(wikiCreateParams: WikiInterfaces.WikiCreateParametersV2, project?: string): Promise; deleteWiki(wikiIdentifier: string, project?: string): Promise; getAllWikis(project?: string): Promise; getWiki(wikiIdentifier: string, project?: string): Promise; updateWiki(updateParameters: WikiInterfaces.WikiUpdateParameters, wikiIdentifier: string, project?: string): Promise; } export declare class WikiApi extends basem.ClientApiBase implements IWikiApi { constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions); static readonly RESOURCE_AREA_ID = "bf7d82a0-8aa5-4613-94ef-6172a5ea01f3"; /** * Uploads an attachment on a comment on a wiki page. * * @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. */ createCommentAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, project: string, wikiIdentifier: string, pageId: number): Promise; /** * Downloads an attachment on a comment on a wiki page. * * @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. */ getAttachmentContent(project: string, wikiIdentifier: string, pageId: number, attachmentId: string): Promise; /** * Add a reaction on a wiki page comment. * * @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 */ addCommentReaction(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType): Promise; /** * Delete a reaction on a wiki page comment. * * @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 */ deleteCommentReaction(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType): Promise; /** * 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} 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 */ getEngagedUsers(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType, top?: number, skip?: number): Promise; /** * Add a comment on a wiki page. * * @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. */ addComment(request: Comments_Contracts.CommentCreateParameters, project: string, wikiIdentifier: string, pageId: number): Promise; /** * Delete a comment on a wiki page. * * @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. */ deleteComment(project: string, wikiIdentifier: string, pageId: number, id: number): Promise; /** * Returns a comment associated with the Wiki Page. * * @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. */ getComment(project: string, wikiIdentifier: string, pageId: number, id: number, excludeDeleted?: boolean, expand?: Comments_Contracts.CommentExpandOptions): Promise; /** * Returns a pageable list of comments. * * @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. */ listComments(project: string, wikiIdentifier: string, pageId: number, top?: number, continuationToken?: string, excludeDeleted?: boolean, expand?: Comments_Contracts.CommentExpandOptions, order?: Comments_Contracts.CommentSortOrder, parentId?: number): Promise; /** * Update a comment on a wiki page. * * @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. */ updateComment(comment: Comments_Contracts.CommentUpdateParameters, project: string, wikiIdentifier: string, pageId: number, id: number): Promise; /** * 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 {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) */ getPageText(project: string, wikiIdentifier: string, path?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean): Promise; /** * 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 {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) */ getPageZip(project: string, wikiIdentifier: string, path?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean): Promise; /** * 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} 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) */ getPageByIdText(project: string, wikiIdentifier: string, id: number, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContent?: boolean): Promise; /** * 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} 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) */ getPageByIdZip(project: string, wikiIdentifier: string, id: number, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContent?: boolean): Promise; /** * Returns pageable list of Wiki Pages * * @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). */ getPagesBatch(pagesBatchRequest: WikiInterfaces.WikiPagesBatchRequest, project: string, wikiIdentifier: string, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Promise; /** * Returns page detail corresponding to Page 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. */ getPageData(project: string, wikiIdentifier: string, pageId: number, pageViewsForDays?: number): Promise; /** * Creates a new page view stats resource or updates an existing page view stats resource. * * @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. */ createOrUpdatePageViewStats(project: string, wikiIdentifier: string, wikiVersion: GitInterfaces.GitVersionDescriptor, path: string, oldPath?: string): Promise; /** * Creates the wiki resource. * * @param {WikiInterfaces.WikiCreateParametersV2} wikiCreateParams - Parameters for the wiki creation. * @param {string} project - Project ID or project name */ createWiki(wikiCreateParams: WikiInterfaces.WikiCreateParametersV2, project?: string): Promise; /** * Deletes the wiki corresponding to the wiki ID or wiki name provided. * * @param {string} wikiIdentifier - Wiki ID or wiki name. * @param {string} project - Project ID or project name */ deleteWiki(wikiIdentifier: string, project?: string): Promise; /** * Gets all wikis in a project or collection. * * @param {string} project - Project ID or project name */ getAllWikis(project?: string): Promise; /** * Gets the wiki corresponding to the wiki ID or wiki name provided. * * @param {string} wikiIdentifier - Wiki ID or wiki name. * @param {string} project - Project ID or project name */ getWiki(wikiIdentifier: string, project?: string): Promise; /** * Updates the wiki corresponding to the wiki ID or wiki name provided using the update parameters. * * @param {WikiInterfaces.WikiUpdateParameters} updateParameters - Update parameters. * @param {string} wikiIdentifier - Wiki ID or wiki name. * @param {string} project - Project ID or project name */ updateWiki(updateParameters: WikiInterfaces.WikiUpdateParameters, wikiIdentifier: string, project?: string): Promise; }