UNPKG

20.2 kBTypeScriptView Raw
1/// <reference types="node" />
2import basem = require('./ClientApiBases');
3import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
4import TfvcInterfaces = require("./interfaces/TfvcInterfaces");
5import VSSInterfaces = require("./interfaces/common/VSSInterfaces");
6export interface ITfvcApi extends basem.ClientApiBase {
7 getBranch(path: string, project?: string, includeParent?: boolean, includeChildren?: boolean): Promise<TfvcInterfaces.TfvcBranch>;
8 getBranches(project?: string, includeParent?: boolean, includeChildren?: boolean, includeDeleted?: boolean, includeLinks?: boolean): Promise<TfvcInterfaces.TfvcBranch[]>;
9 getBranchRefs(scopePath: string, project?: string, includeDeleted?: boolean, includeLinks?: boolean): Promise<TfvcInterfaces.TfvcBranchRef[]>;
10 getChangesetChanges(id?: number, skip?: number, top?: number): Promise<VSSInterfaces.PagedList<TfvcInterfaces.TfvcChange>>;
11 createChangeset(changeset: TfvcInterfaces.TfvcChangeset, project?: string): Promise<TfvcInterfaces.TfvcChangesetRef>;
12 getChangeset(id: number, project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TfvcInterfaces.TfvcChangesetSearchCriteria): Promise<TfvcInterfaces.TfvcChangeset>;
13 getChangesets(project?: string, maxCommentLength?: number, skip?: number, top?: number, orderby?: string, searchCriteria?: TfvcInterfaces.TfvcChangesetSearchCriteria): Promise<TfvcInterfaces.TfvcChangesetRef[]>;
14 getBatchedChangesets(changesetsRequestData: TfvcInterfaces.TfvcChangesetsRequestData): Promise<TfvcInterfaces.TfvcChangesetRef[]>;
15 getChangesetWorkItems(id?: number): Promise<TfvcInterfaces.AssociatedWorkItem[]>;
16 getItemsBatch(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project?: string): Promise<TfvcInterfaces.TfvcItem[][]>;
17 getItemsBatchZip(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project?: string): Promise<NodeJS.ReadableStream>;
18 getItem(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor, includeContent?: boolean): Promise<TfvcInterfaces.TfvcItem>;
19 getItemContent(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
20 getItems(project?: string, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, includeLinks?: boolean, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Promise<TfvcInterfaces.TfvcItem[]>;
21 getItemText(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
22 getItemZip(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
23 getLabelItems(labelId: string, top?: number, skip?: number): Promise<TfvcInterfaces.TfvcItem[]>;
24 getLabel(labelId: string, requestData: TfvcInterfaces.TfvcLabelRequestData, project?: string): Promise<TfvcInterfaces.TfvcLabel>;
25 getLabels(requestData: TfvcInterfaces.TfvcLabelRequestData, project?: string, top?: number, skip?: number): Promise<TfvcInterfaces.TfvcLabelRef[]>;
26 getShelvesetChanges(shelvesetId: string, top?: number, skip?: number): Promise<TfvcInterfaces.TfvcChange[]>;
27 getShelveset(shelvesetId: string, requestData?: TfvcInterfaces.TfvcShelvesetRequestData): Promise<TfvcInterfaces.TfvcShelveset>;
28 getShelvesets(requestData?: TfvcInterfaces.TfvcShelvesetRequestData, top?: number, skip?: number): Promise<TfvcInterfaces.TfvcShelvesetRef[]>;
29 getShelvesetWorkItems(shelvesetId: string): Promise<TfvcInterfaces.AssociatedWorkItem[]>;
30 getTfvcStatistics(project?: string, scopePath?: string): Promise<TfvcInterfaces.TfvcStatistics>;
31}
32export declare class TfvcApi extends basem.ClientApiBase implements ITfvcApi {
33 constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions);
34 static readonly RESOURCE_AREA_ID = "8aa40520-446d-40e6-89f6-9c9f9ce44c48";
35 /**
36 * Get a single branch hierarchy at the given path with parents or children as specified.
37 *
38 * @param {string} path - Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder.
39 * @param {string} project - Project ID or project name
40 * @param {boolean} includeParent - Return the parent branch, if there is one. Default: False
41 * @param {boolean} includeChildren - Return child branches, if there are any. Default: False
42 */
43 getBranch(path: string, project?: string, includeParent?: boolean, includeChildren?: boolean): Promise<TfvcInterfaces.TfvcBranch>;
44 /**
45 * Get a collection of branch roots -- first-level children, branches with no parents.
46 *
47 * @param {string} project - Project ID or project name
48 * @param {boolean} includeParent - Return the parent branch, if there is one. Default: False
49 * @param {boolean} includeChildren - Return the child branches for each root branch. Default: False
50 * @param {boolean} includeDeleted - Return deleted branches. Default: False
51 * @param {boolean} includeLinks - Return links. Default: False
52 */
53 getBranches(project?: string, includeParent?: boolean, includeChildren?: boolean, includeDeleted?: boolean, includeLinks?: boolean): Promise<TfvcInterfaces.TfvcBranch[]>;
54 /**
55 * Get branch hierarchies below the specified scopePath
56 *
57 * @param {string} scopePath - Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder.
58 * @param {string} project - Project ID or project name
59 * @param {boolean} includeDeleted - Return deleted branches. Default: False
60 * @param {boolean} includeLinks - Return links. Default: False
61 */
62 getBranchRefs(scopePath: string, project?: string, includeDeleted?: boolean, includeLinks?: boolean): Promise<TfvcInterfaces.TfvcBranchRef[]>;
63 /**
64 * Retrieve Tfvc changes for a given changeset.
65 *
66 * @param {number} id - ID of the changeset. Default: null
67 * @param {number} skip - Number of results to skip. Default: null
68 * @param {number} top - The maximum number of results to return. Default: null
69 */
70 getChangesetChanges(id?: number, skip?: number, top?: number): Promise<VSSInterfaces.PagedList<TfvcInterfaces.TfvcChange>>;
71 /**
72 * Create a new changeset.
73 *
74 * @param {TfvcInterfaces.TfvcChangeset} changeset
75 * @param {string} project - Project ID or project name
76 */
77 createChangeset(changeset: TfvcInterfaces.TfvcChangeset, project?: string): Promise<TfvcInterfaces.TfvcChangesetRef>;
78 /**
79 * Retrieve a Tfvc Changeset
80 *
81 * @param {number} id - Changeset Id to retrieve.
82 * @param {string} project - Project ID or project name
83 * @param {number} maxChangeCount - Number of changes to return (maximum 100 changes) Default: 0
84 * @param {boolean} includeDetails - Include policy details and check-in notes in the response. Default: false
85 * @param {boolean} includeWorkItems - Include workitems. Default: false
86 * @param {number} maxCommentLength - Include details about associated work items in the response. Default: null
87 * @param {boolean} includeSourceRename - Include renames. Default: false
88 * @param {number} skip - Number of results to skip. Default: null
89 * @param {number} top - The maximum number of results to return. Default: null
90 * @param {string} orderby - Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order.
91 * @param {TfvcInterfaces.TfvcChangesetSearchCriteria} searchCriteria - Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null
92 */
93 getChangeset(id: number, project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TfvcInterfaces.TfvcChangesetSearchCriteria): Promise<TfvcInterfaces.TfvcChangeset>;
94 /**
95 * Retrieve Tfvc Changesets
96 *
97 * @param {string} project - Project ID or project name
98 * @param {number} maxCommentLength - Include details about associated work items in the response. Default: null
99 * @param {number} skip - Number of results to skip. Default: null
100 * @param {number} top - The maximum number of results to return. Default: null
101 * @param {string} orderby - Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order.
102 * @param {TfvcInterfaces.TfvcChangesetSearchCriteria} searchCriteria - Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null
103 */
104 getChangesets(project?: string, maxCommentLength?: number, skip?: number, top?: number, orderby?: string, searchCriteria?: TfvcInterfaces.TfvcChangesetSearchCriteria): Promise<TfvcInterfaces.TfvcChangesetRef[]>;
105 /**
106 * Returns changesets for a given list of changeset Ids.
107 *
108 * @param {TfvcInterfaces.TfvcChangesetsRequestData} changesetsRequestData - List of changeset IDs.
109 */
110 getBatchedChangesets(changesetsRequestData: TfvcInterfaces.TfvcChangesetsRequestData): Promise<TfvcInterfaces.TfvcChangesetRef[]>;
111 /**
112 * Retrieves the work items associated with a particular changeset.
113 *
114 * @param {number} id - ID of the changeset.
115 */
116 getChangesetWorkItems(id?: number): Promise<TfvcInterfaces.AssociatedWorkItem[]>;
117 /**
118 * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path.
119 *
120 * @param {TfvcInterfaces.TfvcItemRequestData} itemRequestData
121 * @param {string} project - Project ID or project name
122 */
123 getItemsBatch(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project?: string): Promise<TfvcInterfaces.TfvcItem[][]>;
124 /**
125 * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path.
126 *
127 * @param {TfvcInterfaces.TfvcItemRequestData} itemRequestData
128 * @param {string} project - Project ID or project name
129 */
130 getItemsBatchZip(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project?: string): Promise<NodeJS.ReadableStream>;
131 /**
132 * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download.
133 *
134 * @param {string} path - Version control path of an individual item to return.
135 * @param {string} project - Project ID or project name
136 * @param {string} fileName - file name of item returned.
137 * @param {boolean} download - If true, create a downloadable attachment.
138 * @param {string} scopePath - Version control path of a folder to return multiple items.
139 * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder).
140 * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null.
141 * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false.
142 */
143 getItem(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor, includeContent?: boolean): Promise<TfvcInterfaces.TfvcItem>;
144 /**
145 * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download.
146 *
147 * @param {string} path - Version control path of an individual item to return.
148 * @param {string} project - Project ID or project name
149 * @param {string} fileName - file name of item returned.
150 * @param {boolean} download - If true, create a downloadable attachment.
151 * @param {string} scopePath - Version control path of a folder to return multiple items.
152 * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder).
153 * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null.
154 * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false.
155 */
156 getItemContent(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
157 /**
158 * Get a list of Tfvc items
159 *
160 * @param {string} project - Project ID or project name
161 * @param {string} scopePath - Version control path of a folder to return multiple items.
162 * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder).
163 * @param {boolean} includeLinks - True to include links.
164 * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor
165 */
166 getItems(project?: string, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, includeLinks?: boolean, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Promise<TfvcInterfaces.TfvcItem[]>;
167 /**
168 * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download.
169 *
170 * @param {string} path - Version control path of an individual item to return.
171 * @param {string} project - Project ID or project name
172 * @param {string} fileName - file name of item returned.
173 * @param {boolean} download - If true, create a downloadable attachment.
174 * @param {string} scopePath - Version control path of a folder to return multiple items.
175 * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder).
176 * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null.
177 * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false.
178 */
179 getItemText(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
180 /**
181 * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download.
182 *
183 * @param {string} path - Version control path of an individual item to return.
184 * @param {string} project - Project ID or project name
185 * @param {string} fileName - file name of item returned.
186 * @param {boolean} download - If true, create a downloadable attachment.
187 * @param {string} scopePath - Version control path of a folder to return multiple items.
188 * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - None (just the item), or OneLevel (contents of a folder).
189 * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - Version descriptor. Default is null.
190 * @param {boolean} includeContent - Set to true to include item content when requesting json. Default is false.
191 */
192 getItemZip(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor, includeContent?: boolean): Promise<NodeJS.ReadableStream>;
193 /**
194 * Get items under a label.
195 *
196 * @param {string} labelId - Unique identifier of label
197 * @param {number} top - Max number of items to return
198 * @param {number} skip - Number of items to skip
199 */
200 getLabelItems(labelId: string, top?: number, skip?: number): Promise<TfvcInterfaces.TfvcItem[]>;
201 /**
202 * Get a single deep label.
203 *
204 * @param {string} labelId - Unique identifier of label
205 * @param {TfvcInterfaces.TfvcLabelRequestData} requestData - maxItemCount
206 * @param {string} project - Project ID or project name
207 */
208 getLabel(labelId: string, requestData: TfvcInterfaces.TfvcLabelRequestData, project?: string): Promise<TfvcInterfaces.TfvcLabel>;
209 /**
210 * Get a collection of shallow label references.
211 *
212 * @param {TfvcInterfaces.TfvcLabelRequestData} requestData - labelScope, name, owner, and itemLabelFilter
213 * @param {string} project - Project ID or project name
214 * @param {number} top - Max number of labels to return, defaults to 100 when undefined
215 * @param {number} skip - Number of labels to skip
216 */
217 getLabels(requestData: TfvcInterfaces.TfvcLabelRequestData, project?: string, top?: number, skip?: number): Promise<TfvcInterfaces.TfvcLabelRef[]>;
218 /**
219 * Get changes included in a shelveset.
220 *
221 * @param {string} shelvesetId - Shelveset's unique ID
222 * @param {number} top - Max number of changes to return
223 * @param {number} skip - Number of changes to skip
224 */
225 getShelvesetChanges(shelvesetId: string, top?: number, skip?: number): Promise<TfvcInterfaces.TfvcChange[]>;
226 /**
227 * Get a single deep shelveset.
228 *
229 * @param {string} shelvesetId - Shelveset's unique ID
230 * @param {TfvcInterfaces.TfvcShelvesetRequestData} requestData - includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength
231 */
232 getShelveset(shelvesetId: string, requestData?: TfvcInterfaces.TfvcShelvesetRequestData): Promise<TfvcInterfaces.TfvcShelveset>;
233 /**
234 * Return a collection of shallow shelveset references.
235 *
236 * @param {TfvcInterfaces.TfvcShelvesetRequestData} requestData - name, owner, and maxCommentLength
237 * @param {number} top - Max number of shelvesets to return
238 * @param {number} skip - Number of shelvesets to skip
239 */
240 getShelvesets(requestData?: TfvcInterfaces.TfvcShelvesetRequestData, top?: number, skip?: number): Promise<TfvcInterfaces.TfvcShelvesetRef[]>;
241 /**
242 * Get work items associated with a shelveset.
243 *
244 * @param {string} shelvesetId - Shelveset's unique ID
245 */
246 getShelvesetWorkItems(shelvesetId: string): Promise<TfvcInterfaces.AssociatedWorkItem[]>;
247 /**
248 * Provides File Count and Uncompressed Bytes for a Collection/Project at a particular scope for TFVC.
249 *
250 * @param {string} project - Project ID or project name
251 * @param {string} scopePath - '$/' for collection, '$/project' for specific project
252 */
253 getTfvcStatistics(project?: string, scopePath?: string): Promise<TfvcInterfaces.TfvcStatistics>;
254}