screwdriver-api 7.0.175 → 7.0.177
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/package.json
CHANGED
|
@@ -107,6 +107,7 @@ Query Params:
|
|
|
107
107
|
* `page` - *Optional* Specific page of the set to return
|
|
108
108
|
* `count` - *Optional* Number of items per page
|
|
109
109
|
* `sort` - *Optional* Sort rangekey by `ascending` or `descending` (default `descending`)
|
|
110
|
+
* `sortBy` - *Optional* Field to sort by
|
|
110
111
|
* `type` - *Optional* Get pipeline or pr events (default `pipeline`)
|
|
111
112
|
* `prNum` - *Optional* Return only PR events of specified PR number
|
|
112
113
|
* `sha` - *Optional* Search `sha` and `configPipelineSha` for events
|
|
@@ -115,7 +116,8 @@ Query Params:
|
|
|
115
116
|
`GET /pipelines/{id}/events?page={pageNumber}&count={countNumber}&sort={sort}&type={type}&prNum={prNumber}&sha={sha}`
|
|
116
117
|
|
|
117
118
|
`GET /pipelines/{id}/events?id=gt:{eventId}&count={countNumber}` (greater than eventId)
|
|
118
|
-
|
|
119
|
+
|
|
120
|
+
`GET /pipelines/{id}/events?id=lt:{eventId}&count={countNumber}&sort=ascending` (less than eventId)
|
|
119
121
|
|
|
120
122
|
#### Get all pipeline builds
|
|
121
123
|
`page`, `count`, `sort`, `latest`, `sortBy`, `fetchSteps`, `readOnly`, and `groupEventId` are optional
|
|
@@ -17,7 +17,7 @@ const INEQUALITY_SIGNS = /^(gt|lt):([\d]+)$/;
|
|
|
17
17
|
const queryIdSchema = joi
|
|
18
18
|
.alternatives()
|
|
19
19
|
.try(pipelineIdSchema, joi.string().regex(INEQUALITY_SIGNS))
|
|
20
|
-
.
|
|
20
|
+
.description('Event ID; alternatively can use greater than or less than prefix (gt:/lt:)')
|
|
21
21
|
.example('gt:12345');
|
|
22
22
|
|
|
23
23
|
module.exports = () => ({
|
|
@@ -34,7 +34,7 @@ module.exports = () => ({
|
|
|
34
34
|
|
|
35
35
|
handler: async (request, h) => {
|
|
36
36
|
const factory = request.server.app.pipelineFactory;
|
|
37
|
-
const { page, count, sha, prNum, id } = request.query;
|
|
37
|
+
const { page, count, sha, prNum, id, sort, sortBy } = request.query;
|
|
38
38
|
|
|
39
39
|
return factory
|
|
40
40
|
.get(request.params.id)
|
|
@@ -44,7 +44,7 @@ module.exports = () => ({
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const eventType = request.query.type || 'pipeline';
|
|
47
|
-
const config = { params: { type: eventType } };
|
|
47
|
+
const config = { params: { type: eventType }, sort };
|
|
48
48
|
|
|
49
49
|
if (page || count) {
|
|
50
50
|
config.paginate = {
|
|
@@ -53,6 +53,10 @@ module.exports = () => ({
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
if (sortBy) {
|
|
57
|
+
config.sortBy = sortBy;
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
if (prNum) {
|
|
57
61
|
config.params.type = 'pr';
|
|
58
62
|
config.params.prNum = prNum;
|