1 | /// <reference types="node" />
|
2 | import basem = require('./ClientApiBases');
|
3 | import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
|
4 | import Comments_Contracts = require("./interfaces/CommentsInterfaces");
|
5 | import GitInterfaces = require("./interfaces/GitInterfaces");
|
6 | import VSSInterfaces = require("./interfaces/common/VSSInterfaces");
|
7 | import WikiInterfaces = require("./interfaces/WikiInterfaces");
|
8 | export interface IWikiApi extends basem.ClientApiBase {
|
9 | createCommentAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, project: string, wikiIdentifier: string, pageId: number): Promise<Comments_Contracts.CommentAttachment>;
|
10 | getAttachmentContent(project: string, wikiIdentifier: string, pageId: number, attachmentId: string): Promise<NodeJS.ReadableStream>;
|
11 | addCommentReaction(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType): Promise<Comments_Contracts.CommentReaction>;
|
12 | deleteCommentReaction(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType): Promise<Comments_Contracts.CommentReaction>;
|
13 | getEngagedUsers(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType, top?: number, skip?: number): Promise<VSSInterfaces.IdentityRef[]>;
|
14 | addComment(request: Comments_Contracts.CommentCreateParameters, project: string, wikiIdentifier: string, pageId: number): Promise<Comments_Contracts.Comment>;
|
15 | deleteComment(project: string, wikiIdentifier: string, pageId: number, id: number): Promise<void>;
|
16 | getComment(project: string, wikiIdentifier: string, pageId: number, id: number, excludeDeleted?: boolean, expand?: Comments_Contracts.CommentExpandOptions): Promise<Comments_Contracts.Comment>;
|
17 | listComments(project: string, wikiIdentifier: string, pageId: number, top?: number, continuationToken?: string, excludeDeleted?: boolean, expand?: Comments_Contracts.CommentExpandOptions, order?: Comments_Contracts.CommentSortOrder, parentId?: number): Promise<Comments_Contracts.CommentList>;
|
18 | updateComment(comment: Comments_Contracts.CommentUpdateParameters, project: string, wikiIdentifier: string, pageId: number, id: number): Promise<Comments_Contracts.Comment>;
|
19 | getPageText(project: string, wikiIdentifier: string, path?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
|
20 | getPageZip(project: string, wikiIdentifier: string, path?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
|
21 | getPageByIdText(project: string, wikiIdentifier: string, id: number, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
|
22 | getPageByIdZip(project: string, wikiIdentifier: string, id: number, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
|
23 | getPagesBatch(pagesBatchRequest: WikiInterfaces.WikiPagesBatchRequest, project: string, wikiIdentifier: string, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Promise<VSSInterfaces.PagedList<WikiInterfaces.WikiPageDetail>>;
|
24 | getPageData(project: string, wikiIdentifier: string, pageId: number, pageViewsForDays?: number): Promise<WikiInterfaces.WikiPageDetail>;
|
25 | createOrUpdatePageViewStats(project: string, wikiIdentifier: string, wikiVersion: GitInterfaces.GitVersionDescriptor, path: string, oldPath?: string): Promise<WikiInterfaces.WikiPageViewStats>;
|
26 | createWiki(wikiCreateParams: WikiInterfaces.WikiCreateParametersV2, project?: string): Promise<WikiInterfaces.WikiV2>;
|
27 | deleteWiki(wikiIdentifier: string, project?: string): Promise<WikiInterfaces.WikiV2>;
|
28 | getAllWikis(project?: string): Promise<WikiInterfaces.WikiV2[]>;
|
29 | getWiki(wikiIdentifier: string, project?: string): Promise<WikiInterfaces.WikiV2>;
|
30 | updateWiki(updateParameters: WikiInterfaces.WikiUpdateParameters, wikiIdentifier: string, project?: string): Promise<WikiInterfaces.WikiV2>;
|
31 | }
|
32 | export declare class WikiApi extends basem.ClientApiBase implements IWikiApi {
|
33 | constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions);
|
34 | static readonly RESOURCE_AREA_ID = "bf7d82a0-8aa5-4613-94ef-6172a5ea01f3";
|
35 | /**
|
36 | * Uploads an attachment on a comment on a wiki page.
|
37 | *
|
38 | * @param {NodeJS.ReadableStream} contentStream - Content to upload
|
39 | * string} project - Project ID or project name
{ |
40 | * string} wikiIdentifier - Wiki ID or wiki name.
{ |
41 | * number} pageId - Wiki page ID.
{ |
42 | */
|
43 | createCommentAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, project: string, wikiIdentifier: string, pageId: number): Promise<Comments_Contracts.CommentAttachment>;
|
44 | /**
|
45 | * Downloads an attachment on a comment on a wiki page.
|
46 | *
|
47 | * @param {string} project - Project ID or project name
|
48 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
49 | * @param {number} pageId - Wiki page ID.
|
50 | * @param {string} attachmentId - Attachment ID.
|
51 | */
|
52 | getAttachmentContent(project: string, wikiIdentifier: string, pageId: number, attachmentId: string): Promise<NodeJS.ReadableStream>;
|
53 | /**
|
54 | * Add a reaction on a wiki page comment.
|
55 | *
|
56 | * @param {string} project - Project ID or project name
|
57 | * @param {string} wikiIdentifier - Wiki ID or wiki name
|
58 | * @param {number} pageId - Wiki page ID
|
59 | * @param {number} commentId - ID of the associated comment
|
60 | * @param {Comments_Contracts.CommentReactionType} type - Type of the reaction being added
|
61 | */
|
62 | addCommentReaction(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType): Promise<Comments_Contracts.CommentReaction>;
|
63 | /**
|
64 | * Delete a reaction on a wiki page comment.
|
65 | *
|
66 | * @param {string} project - Project ID or project name
|
67 | * @param {string} wikiIdentifier - Wiki ID or name
|
68 | * @param {number} pageId - Wiki page ID
|
69 | * @param {number} commentId - ID of the associated comment
|
70 | * @param {Comments_Contracts.CommentReactionType} type - Type of the reaction being deleted
|
71 | */
|
72 | deleteCommentReaction(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType): Promise<Comments_Contracts.CommentReaction>;
|
73 | /**
|
74 | * 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.
|
75 | *
|
76 | * @param {string} project - Project ID or project name
|
77 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
78 | * @param {number} pageId - Wiki page ID.
|
79 | * @param {number} commentId - ID of the associated comment
|
80 | * @param {Comments_Contracts.CommentReactionType} type - Type of the reaction for which the engaged users are being requested
|
81 | * @param {number} top - Number of enagaged users to be returned in a given page. Optional, defaults to 100
|
82 | * @param {number} skip - Number of engaged users to be skipped to page the next set of engaged users, defaults to 0
|
83 | */
|
84 | getEngagedUsers(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: Comments_Contracts.CommentReactionType, top?: number, skip?: number): Promise<VSSInterfaces.IdentityRef[]>;
|
85 | /**
|
86 | * Add a comment on a wiki page.
|
87 | *
|
88 | * @param {Comments_Contracts.CommentCreateParameters} request - Comment create request.
|
89 | * @param {string} project - Project ID or project name
|
90 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
91 | * @param {number} pageId - Wiki page ID.
|
92 | */
|
93 | addComment(request: Comments_Contracts.CommentCreateParameters, project: string, wikiIdentifier: string, pageId: number): Promise<Comments_Contracts.Comment>;
|
94 | /**
|
95 | * Delete a comment on a wiki page.
|
96 | *
|
97 | * @param {string} project - Project ID or project name
|
98 | * @param {string} wikiIdentifier - Wiki ID or name.
|
99 | * @param {number} pageId - Wiki page ID.
|
100 | * @param {number} id - Comment ID.
|
101 | */
|
102 | deleteComment(project: string, wikiIdentifier: string, pageId: number, id: number): Promise<void>;
|
103 | /**
|
104 | * Returns a comment associated with the Wiki Page.
|
105 | *
|
106 | * @param {string} project - Project ID or project name
|
107 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
108 | * @param {number} pageId - Wiki page ID.
|
109 | * @param {number} id - ID of the comment to return.
|
110 | * @param {boolean} excludeDeleted - Specify if the deleted comment should be skipped.
|
111 | * @param {Comments_Contracts.CommentExpandOptions} expand - Specifies the additional data retrieval options for comments.
|
112 | */
|
113 | getComment(project: string, wikiIdentifier: string, pageId: number, id: number, excludeDeleted?: boolean, expand?: Comments_Contracts.CommentExpandOptions): Promise<Comments_Contracts.Comment>;
|
114 | /**
|
115 | * Returns a pageable list of comments.
|
116 | *
|
117 | * @param {string} project - Project ID or project name
|
118 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
119 | * @param {number} pageId - Wiki page ID.
|
120 | * @param {number} top - Max number of comments to return.
|
121 | * @param {string} continuationToken - Used to query for the next page of comments.
|
122 | * @param {boolean} excludeDeleted - Specify if the deleted comments should be skipped.
|
123 | * @param {Comments_Contracts.CommentExpandOptions} expand - Specifies the additional data retrieval options for comments.
|
124 | * @param {Comments_Contracts.CommentSortOrder} order - Order in which the comments should be returned.
|
125 | * @param {number} parentId - CommentId of the parent comment.
|
126 | */
|
127 | listComments(project: string, wikiIdentifier: string, pageId: number, top?: number, continuationToken?: string, excludeDeleted?: boolean, expand?: Comments_Contracts.CommentExpandOptions, order?: Comments_Contracts.CommentSortOrder, parentId?: number): Promise<Comments_Contracts.CommentList>;
|
128 | /**
|
129 | * Update a comment on a wiki page.
|
130 | *
|
131 | * @param {Comments_Contracts.CommentUpdateParameters} comment - Comment update request.
|
132 | * @param {string} project - Project ID or project name
|
133 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
134 | * @param {number} pageId - Wiki page ID.
|
135 | * @param {number} id - Comment ID.
|
136 | */
|
137 | updateComment(comment: Comments_Contracts.CommentUpdateParameters, project: string, wikiIdentifier: string, pageId: number, id: number): Promise<Comments_Contracts.Comment>;
|
138 | /**
|
139 | * 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.
|
140 | *
|
141 | * @param {string} project - Project ID or project name
|
142 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
143 | * @param {string} path - Wiki page path.
|
144 | * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional).
|
145 | * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - GitVersionDescriptor for the page. Defaults to the default branch (Optional).
|
146 | * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional)
|
147 | */
|
148 | getPageText(project: string, wikiIdentifier: string, path?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
|
149 | /**
|
150 | * 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.
|
151 | *
|
152 | * @param {string} project - Project ID or project name
|
153 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
154 | * @param {string} path - Wiki page path.
|
155 | * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional).
|
156 | * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - GitVersionDescriptor for the page. Defaults to the default branch (Optional).
|
157 | * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional)
|
158 | */
|
159 | getPageZip(project: string, wikiIdentifier: string, path?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, versionDescriptor?: GitInterfaces.GitVersionDescriptor, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
|
160 | /**
|
161 | * 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.
|
162 | *
|
163 | * @param {string} project - Project ID or project name
|
164 | * @param {string} wikiIdentifier - Wiki ID or wiki name..
|
165 | * @param {number} id - Wiki page ID.
|
166 | * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional).
|
167 | * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional)
|
168 | */
|
169 | getPageByIdText(project: string, wikiIdentifier: string, id: number, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
|
170 | /**
|
171 | * 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.
|
172 | *
|
173 | * @param {string} project - Project ID or project name
|
174 | * @param {string} wikiIdentifier - Wiki ID or wiki name..
|
175 | * @param {number} id - Wiki page ID.
|
176 | * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - Recursion level for subpages retrieval. Defaults to `None` (Optional).
|
177 | * @param {boolean} includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional)
|
178 | */
|
179 | getPageByIdZip(project: string, wikiIdentifier: string, id: number, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
|
180 | /**
|
181 | * Returns pageable list of Wiki Pages
|
182 | *
|
183 | * @param {WikiInterfaces.WikiPagesBatchRequest} pagesBatchRequest - Wiki batch page request.
|
184 | * @param {string} project - Project ID or project name
|
185 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
186 | * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - GitVersionDescriptor for the page. (Optional in case of ProjectWiki).
|
187 | */
|
188 | getPagesBatch(pagesBatchRequest: WikiInterfaces.WikiPagesBatchRequest, project: string, wikiIdentifier: string, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Promise<VSSInterfaces.PagedList<WikiInterfaces.WikiPageDetail>>;
|
189 | /**
|
190 | * Returns page detail corresponding to Page ID.
|
191 | *
|
192 | * @param {string} project - Project ID or project name
|
193 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
194 | * @param {number} pageId - Wiki page ID.
|
195 | * @param {number} pageViewsForDays - last N days from the current day for which page views is to be returned. It's inclusive of current day.
|
196 | */
|
197 | getPageData(project: string, wikiIdentifier: string, pageId: number, pageViewsForDays?: number): Promise<WikiInterfaces.WikiPageDetail>;
|
198 | /**
|
199 | * Creates a new page view stats resource or updates an existing page view stats resource.
|
200 | *
|
201 | * @param {string} project - Project ID or project name
|
202 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
203 | * @param {GitInterfaces.GitVersionDescriptor} wikiVersion - Wiki version.
|
204 | * @param {string} path - Wiki page path.
|
205 | * @param {string} oldPath - Old page path. This is optional and required to rename path in existing page view stats.
|
206 | */
|
207 | createOrUpdatePageViewStats(project: string, wikiIdentifier: string, wikiVersion: GitInterfaces.GitVersionDescriptor, path: string, oldPath?: string): Promise<WikiInterfaces.WikiPageViewStats>;
|
208 | /**
|
209 | * Creates the wiki resource.
|
210 | *
|
211 | * @param {WikiInterfaces.WikiCreateParametersV2} wikiCreateParams - Parameters for the wiki creation.
|
212 | * @param {string} project - Project ID or project name
|
213 | */
|
214 | createWiki(wikiCreateParams: WikiInterfaces.WikiCreateParametersV2, project?: string): Promise<WikiInterfaces.WikiV2>;
|
215 | /**
|
216 | * Deletes the wiki corresponding to the wiki ID or wiki name provided.
|
217 | *
|
218 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
219 | * @param {string} project - Project ID or project name
|
220 | */
|
221 | deleteWiki(wikiIdentifier: string, project?: string): Promise<WikiInterfaces.WikiV2>;
|
222 | /**
|
223 | * Gets all wikis in a project or collection.
|
224 | *
|
225 | * @param {string} project - Project ID or project name
|
226 | */
|
227 | getAllWikis(project?: string): Promise<WikiInterfaces.WikiV2[]>;
|
228 | /**
|
229 | * Gets the wiki corresponding to the wiki ID or wiki name provided.
|
230 | *
|
231 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
232 | * @param {string} project - Project ID or project name
|
233 | */
|
234 | getWiki(wikiIdentifier: string, project?: string): Promise<WikiInterfaces.WikiV2>;
|
235 | /**
|
236 | * Updates the wiki corresponding to the wiki ID or wiki name provided using the update parameters.
|
237 | *
|
238 | * @param {WikiInterfaces.WikiUpdateParameters} updateParameters - Update parameters.
|
239 | * @param {string} wikiIdentifier - Wiki ID or wiki name.
|
240 | * @param {string} project - Project ID or project name
|
241 | */
|
242 | updateWiki(updateParameters: WikiInterfaces.WikiUpdateParameters, wikiIdentifier: string, project?: string): Promise<WikiInterfaces.WikiV2>;
|
243 | }
|