@itentialopensource/adapter-azure_devops 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ## 0.1.6 [12-01-2022]
3
+
4
+ * ADAPT-2476
5
+
6
+ See merge request itentialopensource/adapters/devops-netops/adapter-azure_devops!6
7
+
8
+ ---
9
+
10
+ ## 0.1.5 [11-22-2022]
11
+
12
+ * Implement API request Commits – Get Commits
13
+
14
+ See merge request itentialopensource/adapters/devops-netops/adapter-azure_devops!5
15
+
16
+ ---
17
+
2
18
  ## 0.1.4 [11-22-2022]
3
19
 
4
20
  * Query parameter across all apis showing as “apiVersion” instead of api-version
package/adapter.js CHANGED
@@ -5003,6 +5003,124 @@ class AzureDevops extends AdapterBaseCl {
5003
5003
  }
5004
5004
  }
5005
5005
 
5006
+ /**
5007
+ * @function commitsGetCommits
5008
+ * @pronghornType method
5009
+ * @name commitsGetCommits
5010
+ * @summary Retrieve git commits for a project.
5011
+ *
5012
+ * @param {string} organization - The name of the Azure DevOps organization.
5013
+ * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified.
5014
+ * @param {string} project - Project ID or project name
5015
+ * @param {number} [skip] - Number of entries to skip.
5016
+ * @param {number} [top] - Maximum number of entries to retrieve.
5017
+ * @param {string} searchCriteriaAuthor - Alias or display name of the author
5018
+ * @param {string} searchCriteriaCompareVersionVersion - Version string identifier (name of tag/branch, SHA1 of commit)
5019
+ * @param {string} searchCriteriaCompareVersionVersionOptions - Version options - Specify additional modifiers to version (e.g Previous)
5020
+ * @param {string} searchCriteriaCompareVersionVersionType - Version type (branch, tag, or commit). Determines how Id is interpreted
5021
+ * @param {boolean} searchCriteriaExcludeDeletes - This determines whether to exclude delete entries of the specified path.
5022
+ * @param {string} searchCriteriaFromCommitId - If provided, a lower bound for filtering commits alphabetically
5023
+ * @param {string} searchCriteriaFromDate - If provided, only include history entries created after this date
5024
+ * @param {string} searchCriteriaHistoryMode - What Git history mode should be used.
5025
+ * @param {array} searchCriteriaIds - If provided, specifies the exact commit ids of the commits to fetch
5026
+ * @param {boolean} searchCriteriaIncludeLinks - Whether to include the _links field on the shallow references
5027
+ * @param {boolean} searchCriteriaIncludePushData - Whether to include the push information
5028
+ * @param {boolean} searchCriteriaIncludeUserImageUrl - Whether to include the image Url for committers and authors
5029
+ * @param {boolean} searchCriteriaIncludeWorkItems - Whether to include linked work items
5030
+ * @param {string} searchCriteriaItemPath - Path of item to search under
5031
+ * @param {string} searchCriteriaItemVersionVersion - Version string identifier (name of tag/branch, SHA1 of commit)
5032
+ * @param {string} searchCriteriaItemVersionVersionOptions - Version options - Specify additional modifiers to version (e.g Previous)
5033
+ * @param {string} searchCriteriaItemVersionVersionType - Version type (branch, tag, or commit). Determines how Id is interpreted
5034
+ * @param {boolean} searchCriteriaShowOldestCommitsFirst - If enabled, this option will ignore the itemVersion and compareVersion parameters
5035
+ * @param {string} searchCriteriaToCommitId - If provided, an upper bound for filtering commits alphabetically
5036
+ * @param {string} searchCriteriaToDate - If provided, only include history entries created before this date (string)
5037
+ * @param {string} searchCriteriaUser - Alias or display name of the committer
5038
+ * @param {string} apiVersion - Version of the API to use. This should be set to '7.1-preview.1' to use this version of the api.
5039
+ * @param {getCallback} callback - a callback function to return the result
5040
+ * @return {object} results - An object containing the response of the action
5041
+ *
5042
+ * @route {GET} /commitsGetCommits
5043
+ * @roles admin
5044
+ * @task true
5045
+ */
5046
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
5047
+ commitsGetCommits(organization, repositoryId, project, skip, top, searchCriteriaAuthor, searchCriteriaCompareVersionVersion, searchCriteriaCompareVersionVersionOptions, searchCriteriaCompareVersionVersionType, searchCriteriaExcludeDeletes, searchCriteriaFromCommitId, searchCriteriaFromDate, searchCriteriaHistoryMode, searchCriteriaIds, searchCriteriaIncludeLinks, searchCriteriaIncludePushData, searchCriteriaIncludeUserImageUrl, searchCriteriaIncludeWorkItems, searchCriteriaItemPath, searchCriteriaItemVersionVersion, searchCriteriaItemVersionVersionOptions, searchCriteriaItemVersionVersionType, searchCriteriaShowOldestCommitsFirst, searchCriteriaToCommitId, searchCriteriaToDate, searchCriteriaUser, apiVersion, callback) {
5048
+ const meth = 'adapter-commitsGetCommits';
5049
+ const origin = `${this.id}-${meth}`;
5050
+ log.trace(origin);
5051
+
5052
+ if (this.suspended && this.suspendMode === 'error') {
5053
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5054
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5055
+ return callback(null, errorObj);
5056
+ }
5057
+
5058
+ /* HERE IS WHERE YOU VALIDATE DATA */
5059
+ if (organization === undefined || organization === null || organization === '') {
5060
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['organization'], null, null, null);
5061
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5062
+ return callback(null, errorObj);
5063
+ }
5064
+ if (repositoryId === undefined || repositoryId === null || repositoryId === '') {
5065
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['repositoryId'], null, null, null);
5066
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5067
+ return callback(null, errorObj);
5068
+ }
5069
+ if (apiVersion === undefined || apiVersion === null || apiVersion === '') {
5070
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['apiVersion'], null, null, null);
5071
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5072
+ return callback(null, errorObj);
5073
+ }
5074
+
5075
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
5076
+ const queryParamsAvailable = { skip, top, searchCriteriaAuthor, searchCriteriaCompareVersionVersion, searchCriteriaCompareVersionVersionOptions, searchCriteriaCompareVersionVersionType, searchCriteriaExcludeDeletes, searchCriteriaFromCommitId, searchCriteriaFromDate, searchCriteriaHistoryMode, searchCriteriaIds, searchCriteriaIncludeLinks, searchCriteriaIncludePushData, searchCriteriaIncludeUserImageUrl, searchCriteriaIncludeWorkItems, searchCriteriaItemPath, searchCriteriaItemVersionVersion, searchCriteriaItemVersionVersionOptions, searchCriteriaItemVersionVersionType, searchCriteriaShowOldestCommitsFirst, searchCriteriaToCommitId, searchCriteriaToDate, searchCriteriaUser, apiVersion };
5077
+ const queryParams = {};
5078
+ const pathVars = [organization, project, repositoryId];
5079
+ const bodyVars = {};
5080
+
5081
+ // loop in template. long callback arg name to avoid identifier conflicts
5082
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
5083
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
5084
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
5085
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
5086
+ }
5087
+ });
5088
+
5089
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5090
+ // see adapter code documentation for more information on the request object's fields
5091
+ const reqObj = {
5092
+ payload: bodyVars,
5093
+ uriPathVars: pathVars,
5094
+ uriQuery: queryParams
5095
+ };
5096
+
5097
+ try {
5098
+ // Make the call -
5099
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5100
+ return this.requestHandlerInst.identifyRequest('Commits', 'commitsGetCommits', reqObj, true, (irReturnData, irReturnError) => {
5101
+ // if we received an error or their is no response on the results
5102
+ // return an error
5103
+ if (irReturnError) {
5104
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5105
+ return callback(null, irReturnError);
5106
+ }
5107
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5108
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['commitsGetCommits'], null, null, null);
5109
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5110
+ return callback(null, errorObj);
5111
+ }
5112
+
5113
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5114
+ // return the response
5115
+ return callback(irReturnData, null);
5116
+ });
5117
+ } catch (ex) {
5118
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
5119
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5120
+ return callback(null, errorObj);
5121
+ }
5122
+ }
5123
+
5006
5124
  /**
5007
5125
  * @function commitsGetCommitsBatch
5008
5126
  * @pronghornType method
@@ -5876,12 +5994,15 @@ class AzureDevops extends AdapterBaseCl {
5876
5994
  * @param {string} organization - The name of the Azure DevOps organization.
5877
5995
  * @param {string} repositoryId - The name or ID of the repository.
5878
5996
  * @param {string} project - Project ID or project name
5997
+ * @param {string} [itemPath] - The item path.
5879
5998
  * @param {string} [scopePath] - The path scope. The default is null.
5880
5999
  * @param {string} [recursionLevel] - The recursion level of this request. The default is 'none', no recursion.
5881
6000
  * @param {boolean} [includeContentMetadata] - Set to true to include content metadata. Default is false.
5882
6001
  * @param {boolean} [latestProcessedChange] - Set to true to include the latest changes. Default is false.
5883
6002
  * @param {boolean} [download] - Set to true to download the response as a file. Default is false.
5884
6003
  * @param {boolean} [includeLinks] - Set to true to include links to items. Default is false.
6004
+ * @param {boolean} [includeContent] - Set to true to include item content when requesting json. Default is false.
6005
+ * @param {boolean} [resolveLfs] - Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.
5885
6006
  * @param {string} [format] - If specified, this overrides the HTTP Accept request header to return either 'json' or 'zip'. If $format is specified, then api-version should also be specified as a quer...(description truncated)
5886
6007
  * @param {string} [versionDescriptorVersion] - Version string identifier (name of tag\/branch, SHA1 of commit)
5887
6008
  * @param {string} [versionDescriptorVersionOptions] - Version options - Specify additional modifiers to version (e.g Previous)
@@ -5895,7 +6016,7 @@ class AzureDevops extends AdapterBaseCl {
5895
6016
  * @task true
5896
6017
  */
5897
6018
  /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
5898
- itemsList(organization, repositoryId, project, scopePath, recursionLevel = 'none', includeContentMetadata, latestProcessedChange, download, includeLinks, format, versionDescriptorVersion, versionDescriptorVersionOptions = 'none', versionDescriptorVersionType = 'branch', apiVersion, callback) {
6019
+ itemsList(organization, repositoryId, project, itemPath, scopePath, recursionLevel = 'none', includeContentMetadata, latestProcessedChange, download, includeLinks, includeContent, resolveLfs, format, versionDescriptorVersion, versionDescriptorVersionOptions = 'none', versionDescriptorVersionType = 'branch', apiVersion, callback) {
5899
6020
  const meth = 'adapter-itemsList';
5900
6021
  const origin = `${this.id}-${meth}`;
5901
6022
  log.trace(origin);
@@ -5927,9 +6048,14 @@ class AzureDevops extends AdapterBaseCl {
5927
6048
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5928
6049
  return callback(null, errorObj);
5929
6050
  }
6051
+ if (itemPath === undefined || itemPath === null || itemPath === '') {
6052
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemPath'], null, null, null);
6053
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6054
+ return callback(null, errorObj);
6055
+ }
5930
6056
 
5931
6057
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
5932
- const queryParamsAvailable = { scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, includeLinks, format, versionDescriptorVersion, versionDescriptorVersionOptions, versionDescriptorVersionType, apiVersion };
6058
+ const queryParamsAvailable = { itemPath, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, includeLinks, includeContent, resolveLfs, format, versionDescriptorVersion, versionDescriptorVersionOptions, versionDescriptorVersionType, apiVersion };
5933
6059
  const queryParams = {};
5934
6060
  const pathVars = [organization, project, repositoryId];
5935
6061
  const bodyVars = {};
@@ -63,6 +63,27 @@
63
63
  }
64
64
  ]
65
65
  },
66
+ {
67
+ "name": "commitsGetCommits",
68
+ "protocol": "REST",
69
+ "method": "GET",
70
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/_apis/git/repositories/{pathv3}/commits?{query}",
71
+ "requestSchema": "schema.json",
72
+ "responseSchema": "schema.json",
73
+ "timeout": 0,
74
+ "sendEmpty": false,
75
+ "sendGetBody": false,
76
+ "requestDatatype": "JSON",
77
+ "responseDatatype": "JSON",
78
+ "headers": {},
79
+ "responseObjects": [
80
+ {
81
+ "type": "default",
82
+ "key": "",
83
+ "mockFile": ""
84
+ }
85
+ ]
86
+ },
66
87
  {
67
88
  "name": "commitsGetCommitsBatch",
68
89
  "protocol": "REST",
@@ -8,15 +8,269 @@
8
8
  "ph_request_type": {
9
9
  "type": "string",
10
10
  "description": "type of request (internal to adapter)",
11
- "default": "commitsGetPushCommits",
11
+ "default": "commitsGetCommits",
12
12
  "enum": [
13
13
  "commitsGetPushCommits",
14
14
  "commitsGet",
15
15
  "commitsGetChanges",
16
+ "commitsGetCommits",
16
17
  "commitsGetCommitsBatch"
17
18
  ],
18
19
  "external_name": "ph_request_type"
19
20
  },
21
+ "skip": {
22
+ "type": "number",
23
+ "description": "Number of entries to skip",
24
+ "parse": false,
25
+ "encode": false,
26
+ "encrypt": {
27
+ "type": "AES",
28
+ "key": ""
29
+ },
30
+ "external_name": "$skip"
31
+ },
32
+ "top": {
33
+ "type": "number",
34
+ "description": "Maximum number of entries to retrieve",
35
+ "parse": false,
36
+ "encode": false,
37
+ "encrypt": {
38
+ "type": "AES",
39
+ "key": ""
40
+ },
41
+ "external_name": "$top"
42
+ },
43
+ "searchCriteriaAuthor": {
44
+ "type": "string",
45
+ "description": "Alias or display name of the author",
46
+ "parse": false,
47
+ "encode": false,
48
+ "encrypt": {
49
+ "type": "AES",
50
+ "key": ""
51
+ },
52
+ "external_name": "searchCriteria\\.author"
53
+ },
54
+ "searchCriteriaCompareVersionVersion": {
55
+ "type": "string",
56
+ "description": "Version string identifier (name of tag/branch, SHA1 of commit)",
57
+ "parse": false,
58
+ "encode": false,
59
+ "encrypt": {
60
+ "type": "AES",
61
+ "key": ""
62
+ },
63
+ "external_name": "searchCriteria\\.compareVersion\\.version"
64
+ },
65
+ "searchCriteriaCompareVersionVersionOptions": {
66
+ "type": "string",
67
+ "description": "Version options - Specify additional modifiers to version (e.g Previous)",
68
+ "parse": true,
69
+ "encode": false,
70
+ "encrypt": {
71
+ "type": "AES",
72
+ "key": ""
73
+ },
74
+ "external_name": "searchCriteria\\.compareVersion\\.versionOptions"
75
+ },
76
+ "searchCriteriaCompareVersionVersionType": {
77
+ "type": "string",
78
+ "description": "Version type (branch, tag, or commit). Determines how Id is interpreted",
79
+ "parse": false,
80
+ "encode": false,
81
+ "encrypt": {
82
+ "type": "AES",
83
+ "key": ""
84
+ },
85
+ "external_name": "searchCriteria\\.compareVersion\\.versionType"
86
+ },
87
+ "searchCriteriaExcludeDeletes": {
88
+ "type": "boolean",
89
+ "description": "Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path.",
90
+ "parse": false,
91
+ "encode": false,
92
+ "encrypt": {
93
+ "type": "AES",
94
+ "key": ""
95
+ },
96
+ "external_name": "searchCriteria\\.excludeDeletes"
97
+ },
98
+ "searchCriteriaFromCommitId": {
99
+ "type": "string",
100
+ "description": "If provided, a lower bound for filtering commits alphabetically",
101
+ "parse": false,
102
+ "encode": false,
103
+ "encrypt": {
104
+ "type": "AES",
105
+ "key": ""
106
+ },
107
+ "external_name": "searchCriteria\\.fromCommitId"
108
+ },
109
+ "searchCriteriaFromDate": {
110
+ "type": "string",
111
+ "description": "If provided, only include history entries created after this date (string)",
112
+ "parse": false,
113
+ "encode": false,
114
+ "encrypt": {
115
+ "type": "AES",
116
+ "key": ""
117
+ },
118
+ "external_name": "searchCriteria\\.fromDate"
119
+ },
120
+ "searchCriteriaHistoryMode": {
121
+ "type": "string",
122
+ "description": "What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified.",
123
+ "parse": false,
124
+ "encode": false,
125
+ "encrypt": {
126
+ "type": "AES",
127
+ "key": ""
128
+ },
129
+ "external_name": "searchCriteria\\.historyMode"
130
+ },
131
+ "searchCriteriaIds": {
132
+ "type": "array",
133
+ "description": "If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters.",
134
+ "parse": false,
135
+ "encode": false,
136
+ "encrypt": {
137
+ "type": "AES",
138
+ "key": ""
139
+ },
140
+ "external_name": "searchCriteria\\.ids"
141
+ },
142
+ "searchCriteriaIncludeLinks": {
143
+ "type": "boolean",
144
+ "description": "Whether to include the _links field on the shallow references",
145
+ "parse": false,
146
+ "encode": false,
147
+ "encrypt": {
148
+ "type": "AES",
149
+ "key": ""
150
+ },
151
+ "external_name": "searchCriteria\\.includeLinks"
152
+ },
153
+ "searchCriteriaIncludePushData": {
154
+ "type": "boolean",
155
+ "description": "Whether to include the push information",
156
+ "parse": false,
157
+ "encode": false,
158
+ "encrypt": {
159
+ "type": "AES",
160
+ "key": ""
161
+ },
162
+ "external_name": "searchCriteria\\.includePushData"
163
+ },
164
+ "searchCriteriaIncludeUserImageUrl": {
165
+ "type": "boolean",
166
+ "description": "Whether to include the image Url for committers and authors",
167
+ "parse": false,
168
+ "encode": false,
169
+ "encrypt": {
170
+ "type": "AES",
171
+ "key": ""
172
+ },
173
+ "external_name": "searchCriteria\\.includeUserImageUrl"
174
+ },
175
+ "searchCriteriaIncludeWorkItems": {
176
+ "type": "boolean",
177
+ "description": "Whether to include linked work items",
178
+ "parse": false,
179
+ "encode": false,
180
+ "encrypt": {
181
+ "type": "AES",
182
+ "key": ""
183
+ },
184
+ "external_name": "searchCriteria\\.includeWorkItems"
185
+ },
186
+ "searchCriteriaItemPath": {
187
+ "type": "string",
188
+ "description": "Path of item to search under",
189
+ "parse": false,
190
+ "encode": false,
191
+ "encrypt": {
192
+ "type": "AES",
193
+ "key": ""
194
+ },
195
+ "external_name": "searchCriteria\\.itemPath"
196
+ },
197
+ "searchCriteriaItemVersionVersion": {
198
+ "type": "string",
199
+ "description": "Version string identifier (name of tag/branch, SHA1 of commit)",
200
+ "parse": false,
201
+ "encode": false,
202
+ "encrypt": {
203
+ "type": "AES",
204
+ "key": ""
205
+ },
206
+ "external_name": "searchCriteria\\.itemVersion\\.version"
207
+ },
208
+ "searchCriteriaItemVersionVersionOptions": {
209
+ "type": "string",
210
+ "description": "Version options - Specify additional modifiers to version (e.g Previous)",
211
+ "parse": false,
212
+ "encode": false,
213
+ "encrypt": {
214
+ "type": "AES",
215
+ "key": ""
216
+ },
217
+ "external_name": "searchCriteria\\.itemVersion\\.versionOptions"
218
+ },
219
+ "searchCriteriaItemVersionVersionType": {
220
+ "type": "string",
221
+ "description": "Version type (branch, tag, or commit). Determines how Id is interpreted",
222
+ "parse": false,
223
+ "encode": false,
224
+ "encrypt": {
225
+ "type": "AES",
226
+ "key": ""
227
+ },
228
+ "external_name": "searchCriteria\\.itemVersion\\.versionType"
229
+ },
230
+ "searchCriteriaShowOldestCommitsFirst": {
231
+ "type": "boolean",
232
+ "description": "If enabled, this option will ignore the itemVersion and compareVersion parameters",
233
+ "parse": false,
234
+ "encode": false,
235
+ "encrypt": {
236
+ "type": "AES",
237
+ "key": ""
238
+ },
239
+ "external_name": "searchCriteria\\.showOldestCommitsFirst"
240
+ },
241
+ "searchCriteriaToCommitId": {
242
+ "type": "string",
243
+ "description": "If provided, an upper bound for filtering commits alphabetically",
244
+ "parse": false,
245
+ "encode": false,
246
+ "encrypt": {
247
+ "type": "AES",
248
+ "key": ""
249
+ },
250
+ "external_name": "searchCriteria\\.toCommitId"
251
+ },
252
+ "searchCriteriaToDate": {
253
+ "type": "string",
254
+ "description": "If provided, only include history entries created before this date (string)",
255
+ "parse": false,
256
+ "encode": false,
257
+ "encrypt": {
258
+ "type": "AES",
259
+ "key": ""
260
+ },
261
+ "external_name": "searchCriteria\\.toDate"
262
+ },
263
+ "searchCriteriaUser": {
264
+ "type": "string",
265
+ "description": "Alias or display name of the committer",
266
+ "parse": false,
267
+ "encode": false,
268
+ "encrypt": {
269
+ "type": "AES",
270
+ "key": ""
271
+ },
272
+ "external_name": "searchCriteria\\.user"
273
+ },
20
274
  "apiVersion": {
21
275
  "type": "string",
22
276
  "description": "Version of the API to use. This should be set to '6.1-preview.1' to use this version of the api.",
@@ -15,6 +15,17 @@
15
15
  ],
16
16
  "external_name": "ph_request_type"
17
17
  },
18
+ "itemPath": {
19
+ "type": "string",
20
+ "description": "The item path.",
21
+ "parse": false,
22
+ "encode": false,
23
+ "encrypt": {
24
+ "type": "AES",
25
+ "key": ""
26
+ },
27
+ "external_name": "path"
28
+ },
18
29
  "apiVersion": {
19
30
  "type": "string",
20
31
  "description": "Version of the API to use. This should be set to '6.1-preview.1' to use this version of the api.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-azure_devops",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "This adapter integrates with system described as: Azure DevOps.",
5
5
  "main": "adapter.js",
6
6
  "systemName": "Microsoft Azure DevOps",
package/pronghorn.json CHANGED
@@ -24043,6 +24043,300 @@
24043
24043
  },
24044
24044
  "task": true
24045
24045
  },
24046
+ {
24047
+ "name": "commitsGetCommits",
24048
+ "summary": "Retrieve git commits for a project.",
24049
+ "description": "Retrieve git commits for a project.",
24050
+ "input": [
24051
+ {
24052
+ "name": "organization",
24053
+ "type": "string",
24054
+ "info": "The name of the Azure DevOps organization.: string",
24055
+ "required": true,
24056
+ "schema": {
24057
+ "title": "organization",
24058
+ "type": "string"
24059
+ }
24060
+ },
24061
+ {
24062
+ "name": "repositoryId",
24063
+ "type": "string",
24064
+ "info": "The id or friendly name of the repository. To use the friendly name, projectId must also be specified.: string",
24065
+ "required": true,
24066
+ "schema": {
24067
+ "title": "repositoryId",
24068
+ "type": "string"
24069
+ }
24070
+ },
24071
+ {
24072
+ "name": "project",
24073
+ "type": "string",
24074
+ "info": "Project ID or project name: string",
24075
+ "required": false,
24076
+ "schema": {
24077
+ "title": "project",
24078
+ "type": "string"
24079
+ }
24080
+ },
24081
+ {
24082
+ "name": "skip",
24083
+ "type": "number",
24084
+ "info": "Number of entries to skip",
24085
+ "required": false,
24086
+ "schema": {
24087
+ "title": "skip",
24088
+ "type": "number"
24089
+ }
24090
+ },
24091
+ {
24092
+ "name": "top",
24093
+ "type": "number",
24094
+ "info": "Maximum number of entries to retrieve",
24095
+ "required": false,
24096
+ "schema": {
24097
+ "title": "top",
24098
+ "type": "number"
24099
+ }
24100
+ },
24101
+ {
24102
+ "name": "searchCriteriaAuthor",
24103
+ "type": "string",
24104
+ "info": "Alias or display name of the author",
24105
+ "required": false,
24106
+ "schema": {
24107
+ "title": "searchCriteriaAuthor",
24108
+ "type": "string"
24109
+ }
24110
+ },
24111
+ {
24112
+ "name": "searchCriteriaCompareVersionVersion",
24113
+ "type": "string",
24114
+ "info": "Version string identifier (name of tag/branch, SHA1 of commit)",
24115
+ "required": false,
24116
+ "schema": {
24117
+ "title": "searchCriteriaCompareVersionVersion",
24118
+ "type": "string"
24119
+ }
24120
+ },
24121
+ {
24122
+ "name": "searchCriteriaCompareVersionVersionOptions",
24123
+ "type": "string",
24124
+ "info": "Version options - Specify additional modifiers to version (e.g Previous)",
24125
+ "required": false,
24126
+ "schema": {
24127
+ "title": "searchCriteriaCompareVersionVersionOptions",
24128
+ "type": "string"
24129
+ }
24130
+ },
24131
+ {
24132
+ "name": "searchCriteriaCompareVersionVersionType",
24133
+ "type": "string",
24134
+ "info": "Version type (branch, tag, or commit). Determines how Id is interpreted",
24135
+ "required": false,
24136
+ "schema": {
24137
+ "title": "searchCriteriaCompareVersionVersionType",
24138
+ "type": "string"
24139
+ }
24140
+ },
24141
+ {
24142
+ "name": "searchCriteriaExcludeDeletes",
24143
+ "type": "boolean",
24144
+ "info": "Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path.",
24145
+ "required": false,
24146
+ "schema": {
24147
+ "title": "searchCriteriaExcludeDeletes",
24148
+ "type": "boolean"
24149
+ }
24150
+ },
24151
+ {
24152
+ "name": "searchCriteriaFromCommitId",
24153
+ "type": "string",
24154
+ "info": "If provided, a lower bound for filtering commits alphabetically",
24155
+ "required": false,
24156
+ "schema": {
24157
+ "title": "searchCriteriaFromCommitId",
24158
+ "type": "string"
24159
+ }
24160
+ },
24161
+ {
24162
+ "name": "searchCriteriaFromDate",
24163
+ "type": "string",
24164
+ "info": "If provided, only include history entries created after this date (string)",
24165
+ "required": false,
24166
+ "schema": {
24167
+ "title": "searchCriteriaFromDate",
24168
+ "type": "string"
24169
+ }
24170
+ },
24171
+ {
24172
+ "name": "searchCriteriaHistoryMode",
24173
+ "type": "string",
24174
+ "info": "What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified.",
24175
+ "required": false,
24176
+ "schema": {
24177
+ "title": "searchCriteriaHistoryMode",
24178
+ "type": "string"
24179
+ }
24180
+ },
24181
+ {
24182
+ "name": "searchCriteriaIds",
24183
+ "type": "array",
24184
+ "info": "If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters.",
24185
+ "required": false,
24186
+ "schema": {
24187
+ "title": "searchCriteriaIds",
24188
+ "type": "array"
24189
+ }
24190
+ },
24191
+ {
24192
+ "name": "searchCriteriaIncludeLinks",
24193
+ "type": "boolean",
24194
+ "info": "Whether to include the _links field on the shallow references",
24195
+ "required": false,
24196
+ "schema": {
24197
+ "title": "searchCriteriaIncludeLinks",
24198
+ "type": "boolean"
24199
+ }
24200
+ },
24201
+ {
24202
+ "name": "searchCriteriaIncludePushData",
24203
+ "type": "boolean",
24204
+ "info": "Whether to include the push information",
24205
+ "required": false,
24206
+ "schema": {
24207
+ "title": "searchCriteriaIncludePushData",
24208
+ "type": "boolean"
24209
+ }
24210
+ },
24211
+ {
24212
+ "name": "searchCriteriaIncludeUserImageUrl",
24213
+ "type": "boolean",
24214
+ "info": "Whether to include the image Url for committers and authors",
24215
+ "required": false,
24216
+ "schema": {
24217
+ "title": "searchCriteriaIncludeUserImageUrl",
24218
+ "type": "boolean"
24219
+ }
24220
+ },
24221
+ {
24222
+ "name": "searchCriteriaIncludeWorkItems",
24223
+ "type": "boolean",
24224
+ "info": "Whether to include linked work items",
24225
+ "required": false,
24226
+ "schema": {
24227
+ "title": "searchCriteriaIncludeWorkItems",
24228
+ "type": "boolean"
24229
+ }
24230
+ },
24231
+ {
24232
+ "name": "searchCriteriaItemPath",
24233
+ "type": "string",
24234
+ "info": "Path of item to search under",
24235
+ "required": false,
24236
+ "schema": {
24237
+ "title": "searchCriteriaItemPath",
24238
+ "type": "string"
24239
+ }
24240
+ },
24241
+ {
24242
+ "name": "searchCriteriaItemVersionVersion",
24243
+ "type": "string",
24244
+ "info": "Version string identifier (name of tag/branch, SHA1 of commit)",
24245
+ "required": false,
24246
+ "schema": {
24247
+ "title": "searchCriteriaItemVersionVersion",
24248
+ "type": "string"
24249
+ }
24250
+ },
24251
+ {
24252
+ "name": "searchCriteriaItemVersionVersionOptions",
24253
+ "type": "string",
24254
+ "info": "Version options - Specify additional modifiers to version (e.g Previous)",
24255
+ "required": false,
24256
+ "schema": {
24257
+ "title": "searchCriteriaItemVersionVersionOptions",
24258
+ "type": "string"
24259
+ }
24260
+ },
24261
+ {
24262
+ "name": "searchCriteriaItemVersionVersionType",
24263
+ "type": "string",
24264
+ "info": "Version type (branch, tag, or commit). Determines how Id is interpreted",
24265
+ "required": false,
24266
+ "schema": {
24267
+ "title": "searchCriteriaItemVersionVersionType",
24268
+ "type": "string"
24269
+ }
24270
+ },
24271
+ {
24272
+ "name": "searchCriteriaShowOldestCommitsFirst",
24273
+ "type": "boolean",
24274
+ "info": "If enabled, this option will ignore the itemVersion and compareVersion parameters",
24275
+ "required": false,
24276
+ "schema": {
24277
+ "title": "searchCriteriaShowOldestCommitsFirst",
24278
+ "type": "boolean"
24279
+ }
24280
+ },
24281
+ {
24282
+ "name": "searchCriteriaToCommitId",
24283
+ "type": "string",
24284
+ "info": "If provided, an upper bound for filtering commits alphabetically",
24285
+ "required": false,
24286
+ "schema": {
24287
+ "title": "searchCriteriaToCommitId",
24288
+ "type": "string"
24289
+ }
24290
+ },
24291
+ {
24292
+ "name": "searchCriteriaToDate",
24293
+ "type": "string",
24294
+ "info": "If provided, only include history entries created before this date (string)",
24295
+ "required": false,
24296
+ "schema": {
24297
+ "title": "searchCriteriaToDate",
24298
+ "type": "string"
24299
+ }
24300
+ },
24301
+ {
24302
+ "name": "searchCriteriaUser",
24303
+ "type": "string",
24304
+ "info": "Alias or display name of the committer",
24305
+ "required": false,
24306
+ "schema": {
24307
+ "title": "searchCriteriaUser",
24308
+ "type": "string"
24309
+ }
24310
+ },
24311
+ {
24312
+ "name": "apiVersion",
24313
+ "type": "string",
24314
+ "info": "Version of the API to use. This should be set to '7.1-preview.1' to use this version of the api.: string",
24315
+ "required": true,
24316
+ "schema": {
24317
+ "title": "apiVersion",
24318
+ "type": "string"
24319
+ }
24320
+ }
24321
+ ],
24322
+ "output": {
24323
+ "name": "result",
24324
+ "type": "object",
24325
+ "description": "A JSON Object containing status, code and the result",
24326
+ "schema": {
24327
+ "title": "result",
24328
+ "type": "object"
24329
+ }
24330
+ },
24331
+ "roles": [
24332
+ "admin"
24333
+ ],
24334
+ "route": {
24335
+ "verb": "POST",
24336
+ "path": "/commitsGet"
24337
+ },
24338
+ "task": true
24339
+ },
24046
24340
  {
24047
24341
  "name": "commitsGetChanges",
24048
24342
  "summary": "Retrieve changes for a particular commit.",
@@ -27323,6 +27617,16 @@
27323
27617
  "type": "string"
27324
27618
  }
27325
27619
  },
27620
+ {
27621
+ "name": "itemPath",
27622
+ "type": "string",
27623
+ "info": "The item path.",
27624
+ "required": true,
27625
+ "schema": {
27626
+ "title": "itemPath",
27627
+ "type": "string"
27628
+ }
27629
+ },
27326
27630
  {
27327
27631
  "name": "scopePath",
27328
27632
  "type": "string",
@@ -27383,6 +27687,26 @@
27383
27687
  "type": "boolean"
27384
27688
  }
27385
27689
  },
27690
+ {
27691
+ "name": "includeContent",
27692
+ "type": "boolean",
27693
+ "info": "Set to true to include item content when requesting json. Default is false.",
27694
+ "required": false,
27695
+ "schema": {
27696
+ "title": "includeContent",
27697
+ "type": "boolean"
27698
+ }
27699
+ },
27700
+ {
27701
+ "name": "resolveLfs",
27702
+ "type": "boolean",
27703
+ "info": "Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false.",
27704
+ "required": false,
27705
+ "schema": {
27706
+ "title": "resolveLfs",
27707
+ "type": "boolean"
27708
+ }
27709
+ },
27386
27710
  {
27387
27711
  "name": "format",
27388
27712
  "type": "string",
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "version": "0.1.3",
3
- "configLines": 53196,
3
+ "configLines": 53490,
4
4
  "scriptLines": 1707,
5
- "codeLines": 15332,
6
- "testLines": 19737,
7
- "testCases": 963,
8
- "totalCodeLines": 36776,
9
- "wfTasks": 134
5
+ "codeLines": 15450,
6
+ "testLines": 19825,
7
+ "testCases": 968,
8
+ "totalCodeLines": 36982,
9
+ "wfTasks": 135
10
10
  }
@@ -2782,6 +2782,31 @@ describe('[integration] Azure_devops Adapter Test', () => {
2782
2782
  }).timeout(attemptTimeout);
2783
2783
  });
2784
2784
 
2785
+ describe('#commitsGetCommits - errors', () => {
2786
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2787
+ try {
2788
+ a.commitsGetCommits('fakedata', 'fakedata', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 'fakedata', (data, error) => {
2789
+ try {
2790
+ if (stub) {
2791
+ const displayE = 'Error 400 received on request';
2792
+ runErrorAsserts(data, error, 'AD.500', 'Test-azure_devops-connectorRest-handleEndResponse', displayE);
2793
+ } else {
2794
+ runCommonAsserts(data, error);
2795
+ }
2796
+ saveMockData('Commits', 'commitsGetCommits', 'default', data);
2797
+ done();
2798
+ } catch (err) {
2799
+ log.error(`Test Failure: ${err}`);
2800
+ done(err);
2801
+ }
2802
+ });
2803
+ } catch (error) {
2804
+ log.error(`Adapter Exception: ${error}`);
2805
+ done(error);
2806
+ }
2807
+ }).timeout(attemptTimeout);
2808
+ });
2809
+
2785
2810
  const commitsCommitsGetCommitsBatchBodyParam = {
2786
2811
  $skip: 2,
2787
2812
  $top: 7,
@@ -3210,7 +3235,7 @@ describe('[integration] Azure_devops Adapter Test', () => {
3210
3235
  describe('#itemsList - errors', () => {
3211
3236
  it('should work if integrated or standalone with mockdata', (done) => {
3212
3237
  try {
3213
- a.itemsList('fakedata', 'fakedata', 'fakedata', null, null, null, null, null, null, null, null, null, null, 'fakedata', (data, error) => {
3238
+ a.itemsList('fakedata', 'fakedata', 'fakedata', 'fakedata', null, null, null, null, null, null, null, null, null, null, null, null, 'fakedata', (data, error) => {
3214
3239
  try {
3215
3240
  if (stub) {
3216
3241
  runCommonAsserts(data, error);
@@ -4768,6 +4768,69 @@ describe('[unit] Azure_devops Adapter Test', () => {
4768
4768
  }).timeout(attemptTimeout);
4769
4769
  });
4770
4770
 
4771
+ describe('#commitsGetCommits - errors', () => {
4772
+ it('should have a commitsGetCommits function', (done) => {
4773
+ try {
4774
+ assert.equal(true, typeof a.commitsGetCommits === 'function');
4775
+ done();
4776
+ } catch (error) {
4777
+ log.error(`Test Failure: ${error}`);
4778
+ done(error);
4779
+ }
4780
+ }).timeout(attemptTimeout);
4781
+ it('should error if - missing organization', (done) => {
4782
+ try {
4783
+ a.commitsGetCommits(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
4784
+ try {
4785
+ const displayE = 'organization is required';
4786
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-commitsGetCommits', displayE);
4787
+ done();
4788
+ } catch (err) {
4789
+ log.error(`Test Failure: ${err}`);
4790
+ done(err);
4791
+ }
4792
+ });
4793
+ } catch (error) {
4794
+ log.error(`Adapter Exception: ${error}`);
4795
+ done(error);
4796
+ }
4797
+ }).timeout(attemptTimeout);
4798
+ it('should error if - missing repositoryId', (done) => {
4799
+ try {
4800
+ a.commitsGetCommits('fakeparam', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
4801
+ try {
4802
+ const displayE = 'repositoryId is required';
4803
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-commitsGetCommits', displayE);
4804
+ done();
4805
+ } catch (err) {
4806
+ log.error(`Test Failure: ${err}`);
4807
+ done(err);
4808
+ }
4809
+ });
4810
+ } catch (error) {
4811
+ log.error(`Adapter Exception: ${error}`);
4812
+ done(error);
4813
+ }
4814
+ }).timeout(attemptTimeout);
4815
+ it('should error if - missing apiVersion', (done) => {
4816
+ try {
4817
+ a.commitsGetCommits('fakeparam', 'fakeparam', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
4818
+ try {
4819
+ const displayE = 'apiVersion is required';
4820
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-commitsGetCommits', displayE);
4821
+ done();
4822
+ } catch (err) {
4823
+ log.error(`Test Failure: ${err}`);
4824
+ done(err);
4825
+ }
4826
+ });
4827
+ } catch (error) {
4828
+ log.error(`Adapter Exception: ${error}`);
4829
+ done(error);
4830
+ }
4831
+ }).timeout(attemptTimeout);
4832
+ });
4833
+
4771
4834
  describe('#commitsGetCommitsBatch - errors', () => {
4772
4835
  it('should have a commitsGetCommitsBatch function', (done) => {
4773
4836
  try {
@@ -5556,7 +5619,7 @@ describe('[unit] Azure_devops Adapter Test', () => {
5556
5619
  }).timeout(attemptTimeout);
5557
5620
  it('should error if - missing organization', (done) => {
5558
5621
  try {
5559
- a.itemsList(null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
5622
+ a.itemsList(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
5560
5623
  try {
5561
5624
  const displayE = 'organization is required';
5562
5625
  runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-itemsList', displayE);
@@ -5573,7 +5636,7 @@ describe('[unit] Azure_devops Adapter Test', () => {
5573
5636
  }).timeout(attemptTimeout);
5574
5637
  it('should error if - missing repositoryId', (done) => {
5575
5638
  try {
5576
- a.itemsList('fakeparam', null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
5639
+ a.itemsList('fakeparam', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
5577
5640
  try {
5578
5641
  const displayE = 'repositoryId is required';
5579
5642
  runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-itemsList', displayE);
@@ -5590,7 +5653,7 @@ describe('[unit] Azure_devops Adapter Test', () => {
5590
5653
  }).timeout(attemptTimeout);
5591
5654
  it('should error if - missing project', (done) => {
5592
5655
  try {
5593
- a.itemsList('fakeparam', 'fakeparam', null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
5656
+ a.itemsList('fakeparam', 'fakeparam', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
5594
5657
  try {
5595
5658
  const displayE = 'project is required';
5596
5659
  runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-itemsList', displayE);
@@ -5607,7 +5670,7 @@ describe('[unit] Azure_devops Adapter Test', () => {
5607
5670
  }).timeout(attemptTimeout);
5608
5671
  it('should error if - missing apiVersion', (done) => {
5609
5672
  try {
5610
- a.itemsList('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
5673
+ a.itemsList('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
5611
5674
  try {
5612
5675
  const displayE = 'apiVersion is required';
5613
5676
  runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-itemsList', displayE);