screwdriver-api 4.1.177 → 4.1.178
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
package/plugins/events/README.md
CHANGED
|
@@ -24,23 +24,14 @@ module.exports = () => ({
|
|
|
24
24
|
handler: async (request, h) => {
|
|
25
25
|
const { eventFactory } = request.server.app;
|
|
26
26
|
const event = await eventFactory.get(request.params.id);
|
|
27
|
-
const { steps } = request.query;
|
|
28
27
|
|
|
29
28
|
if (!event) {
|
|
30
29
|
throw boom.notFound('Event does not exist');
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
const buildsModel = await event.getBuilds(
|
|
34
|
-
readOnly: true
|
|
35
|
-
});
|
|
32
|
+
const buildsModel = await event.getBuilds();
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (steps) {
|
|
40
|
-
data = await Promise.all(buildsModel.map(async buildModel => buildModel.toJsonWithSteps()));
|
|
41
|
-
} else {
|
|
42
|
-
data = await Promise.all(buildsModel.map(async buildModel => buildModel.toJson()));
|
|
43
|
-
}
|
|
34
|
+
const data = await Promise.all(buildsModel.map(async buildModel => buildModel.toJsonWithSteps()));
|
|
44
35
|
|
|
45
36
|
return h.response(data);
|
|
46
37
|
},
|
|
@@ -50,16 +41,7 @@ module.exports = () => ({
|
|
|
50
41
|
validate: {
|
|
51
42
|
params: joi.object({
|
|
52
43
|
id: eventIdSchema
|
|
53
|
-
})
|
|
54
|
-
query: schema.api.pagination.concat(
|
|
55
|
-
joi.object({
|
|
56
|
-
steps: joi
|
|
57
|
-
.boolean()
|
|
58
|
-
.truthy('true')
|
|
59
|
-
.falsy('false')
|
|
60
|
-
.default(false)
|
|
61
|
-
})
|
|
62
|
-
)
|
|
44
|
+
})
|
|
63
45
|
}
|
|
64
46
|
}
|
|
65
47
|
});
|
package/plugins/jobs/README.md
CHANGED
|
@@ -46,8 +46,6 @@ Example payload:
|
|
|
46
46
|
#### Get list of builds for a single job
|
|
47
47
|
`GET /jobs/{id}/builds`
|
|
48
48
|
|
|
49
|
-
`GET /jobs/{id}/builds?steps=true`
|
|
50
|
-
|
|
51
49
|
`GET /jobs/{id}/builds?page=2&count=30&sort=ascending`
|
|
52
50
|
|
|
53
51
|
`GET /jobs/{id}/builds?page=2&count=30&sort=ascending&sortBy=id`
|
|
@@ -23,7 +23,7 @@ module.exports = () => ({
|
|
|
23
23
|
|
|
24
24
|
handler: async (request, h) => {
|
|
25
25
|
const factory = request.server.app.jobFactory;
|
|
26
|
-
const { sort, sortBy, page, count
|
|
26
|
+
const { sort, sortBy, page, count } = request.query;
|
|
27
27
|
|
|
28
28
|
return factory
|
|
29
29
|
.get(request.params.id)
|
|
@@ -32,7 +32,7 @@ module.exports = () => ({
|
|
|
32
32
|
throw boom.notFound('Job does not exist');
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const config = { sort, sortBy: 'createTime'
|
|
35
|
+
const config = { sort, sortBy: 'createTime' };
|
|
36
36
|
|
|
37
37
|
if (sortBy) {
|
|
38
38
|
config.sortBy = sortBy;
|
|
@@ -45,13 +45,7 @@ module.exports = () => ({
|
|
|
45
45
|
return job.getBuilds(config);
|
|
46
46
|
})
|
|
47
47
|
.then(async builds => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (steps) {
|
|
51
|
-
data = await Promise.all(builds.map(b => b.toJsonWithSteps()));
|
|
52
|
-
} else {
|
|
53
|
-
data = await Promise.all(builds.map(b => b.toJson()));
|
|
54
|
-
}
|
|
48
|
+
const data = await Promise.all(builds.map(b => b.toJsonWithSteps()));
|
|
55
49
|
|
|
56
50
|
return h.response(data);
|
|
57
51
|
})
|
|
@@ -66,15 +60,7 @@ module.exports = () => ({
|
|
|
66
60
|
params: joi.object({
|
|
67
61
|
id: jobIdSchema
|
|
68
62
|
}),
|
|
69
|
-
query: schema.api.pagination
|
|
70
|
-
joi.object({
|
|
71
|
-
steps: joi
|
|
72
|
-
.boolean()
|
|
73
|
-
.truthy('true')
|
|
74
|
-
.falsy('false')
|
|
75
|
-
.default(false)
|
|
76
|
-
})
|
|
77
|
-
)
|
|
63
|
+
query: schema.api.pagination
|
|
78
64
|
}
|
|
79
65
|
}
|
|
80
66
|
});
|